• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getting the results of a sub select
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting the results of a sub select


  • Subject: Re: getting the results of a sub select
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 15 Mar 2005 18:06:35 -0800


On Mar 15, 2005, at 6:00 PM, Theodore Petrosky wrote:

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....

But but but you _don't_ want to _avoid_ the relationship thing. You _want_ to use them.


I feel that I want to push the backend to do some of
the work. Please correct me if this is the wrong
approach.
It's wrong. :-) Trust in EOF. Don't optimize. It was done for you, years ago, by excellent developers. There may come a time when you need to consider optimization. This is not that time.


Chuck


 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:
village.net


This email sent to email@hidden

--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects




_______________________________________________
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


References: 
 >Re: getting the results of a sub select (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: SessionStore and "defaultEditingContext" lock/unlock
  • Next by Date: Re: SessionStore and "defaultEditingContext" lock/unlock
  • Previous by thread: Re: getting the results of a sub select
  • Next by thread: Re: getting the results of a sub select
  • Index(es):
    • Date
    • Thread