Re: getting the results of a sub select
Re: getting the results of a sub select
- Subject: Re: getting the results of a sub select
- From: Theodore Petrosky <email@hidden>
- Date: Tue, 15 Mar 2005 18:00:36 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
But it sounds to me that I would be better off
creating a view in the database and just creating a
link to the view. The view would include the
subselect.
CREATE VIEW myview AS
SELECT ji.jobnumber, (SELECT ci.cname FROM
clientinfo ci WHERE (ji.acode = ci.acode)) FROM
jobinfo ji;
now I can avoid totally the whole relationship
thing....
I feel that I want to push the backend to do some of
the work. Please correct me if this is the wrong
approach. I am more that egar to learn this new (to me
new) method. I am having a few problems with some of
the concepts.
Ted
--- Arturo Perez <email@hidden> wrote:
> Ken Anderson wrote:
>
> > Ted,
> >
> > You need to think of jobs and clients as objects
> that have
> > relationships to each other. If you continue to
> think about things in
> > terms of SQL and specialized queries, you're going
> to have a hard time
> > with EOF (the database layer of WebObjects).
>
> This can not be emphasized enough. If you can stop
> thinking about the
> SQL and just concentrate on what you need to do you
> will avoid a lot of
> frustration. EOModeler can be very helpful in this
> respect. For a
> neophyte WO person just let EOF do what it wants.
> When it can't do
> something or you're tempted to change how EOF has
> defined something come
> check with this list first. Otherwise you'll be
> in for a world of hurt.
>
> > One thing that's important to realize here is
> that, by default, EOF
> > will make a trip to the database for each client
> you need to fetch. If
> > you're displaying client.cname in a table or
> something, that can become
> > very inefficient.
>
> Just to clarify this section as it sounds as if EOF
> will fetch each
> attribute of an object one at a time. EOF will
> fetch the entire object
> and all its attributes. However, for relationships,
> EOF will place a
> fault in the object as a stand-in to avoid joins &
> the possibility of
> loading hundreds of objects when you only need one.
>
>
__________________________________
Do you Yahoo!?
Yahoo! Sports - Sign up for Fantasy Baseball.
http://baseball.fantasysports.yahoo.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden