• 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: fetching on joined table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fetching on joined table


  • Subject: Re: fetching on joined table
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 11 Apr 2011 11:09:34 -0700


On Apr 11, 2011, at 3:12 AM, <email@hidden> wrote:

Hi Chuck,

Tables A, B, C, D haven't relationship but same fileds name.

If they don't have modeled relationships, then you can't use qualifiers.


When i'am using raw rows to translate my sql in webobjects and get my data, I don't have EOF entities but dictionnaries.

So I would like to know what the best practice on my case? create view with my sql request on database and fetching on view  in my model?

I think the best practice would be to change the model (and the schema too, if needed) so that there are relationships and you are fetching entities.  I very rarely need to do a raw row fetch.  If you give us more information on the data, maybe we can suggest a better model.



Chuck


========================================

Message du : 11/04/2011
De : "Chuck Hill " <email@hidden>
A : email@hidden
Copie à : email@hidden
Sujet : Re: fetching on joined table


Hello Ray,


On Apr 8, 2011, at 5:16 PM, email@hidden wrote:

Hi, 

I'm newbie on WebObjects and I have big problem to fetching on joined table.
Example :
I have my SQL like that :

A good rule with WebObjects is "If you are thinking about SQL, you are doing it wrong."  There are times (i.e. when optimizing) when you do need to think about the SQL, but thinking in terms of objects is usually the better way.


select 
a.id b.id as ID,
c.option as option,
decode(d.no, 1, 'one', 2, 'two', 'unknow') as  order

WebObjects (EOF) does not do mixed table selects like this (unless you are selecting Raw Rows).  It selects whole rows of tables and makes them into related Java objects.


from
ta a, tb b, tc c, td d
where
c.option in ('1', '2','3')
and c.option = b.option

How to translate this SQL request in EOF using qualifier or spec qualifier?

Thanks for your help.

What are the relationships in the model between A, B, C, and D?  What are you trying to fetch?


Chuck

-- 
Chuck Hill             Senior Consultant / VP Development

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









-- 
Chuck Hill             Senior Consultant / VP Development

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







Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >fetching on joined table (From: email@hidden)
 >Re: Re: fetching on joined table (From: email@hidden)

  • Prev by Date: Re: wolips moved to github
  • Next by Date: Re: responseForComponentWithName() and session
  • Previous by thread: Re: Re: fetching on joined table
  • Next by thread: Re: Re: fetching on joined table
  • Index(es):
    • Date
    • Thread