• 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: Qualifiers, many-to-many and horizontal inheritance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Qualifiers, many-to-many and horizontal inheritance


  • Subject: Re: Qualifiers, many-to-many and horizontal inheritance
  • From: John Larson <email@hidden>
  • Date: Sat, 22 Jul 2006 07:23:52 -0500

Timo,

Before you go any further with more advanced queries, it looks like you don't have the inheritance working right. EO shouldn't generate sql against the abstract table. In this case, if assets_keywords is a concrete subclass, the sql code should look like exactly what you want.

Do you have the keyword table marked as abstract?

Also, it looks like you have the assets_keywords entity joined by a reference to the keyword table. I say this because of the T1.keyword_id = T2.id in the sql output. If t1 (assets_keywords) is a subclass of the abstract entity keywords, then you shouldn't join it by a reference. Make sure that you don't have a reference in assets_keywords to keyword. (if you were using vertical inheritance, this would be different).

Lastly, make sure that you have assets set as the parent in the assets_keyword entity.

John

On Jul 22, 2006, at 4:28 AM, Timo Hoepfner wrote:


You pretty much have to use some sort of extension to the qualifiers that ship with WO. It looks like Pierre Bernard has posted updated versions of his here:
http://www.bernard-web.com/pierre/webobjects/code.html


Trying these qualifiers right now, but no luck. The generated SQL looks into the wrong tables.

3. All Assets that belong to a certain Keyword and have a certain filename

I tried

q2 = new InSetQualifier(Asset.KEY_KEYWORDS, new NSSet (selectedKeyword));

Which generates SQL like

FROM assets t0, keyword T2, assets_keywords T1
WHERE T2.id IN ( ?) AND T1.keyword_id = T2.id AND t0.id = T1.asset_id

But the keyword table is empty, as it belongs to an abstract entity in the horizontal inheritance scheme. This is the SQL I would need to solve my problems 3 and 4:

FROM assets t0, assets_keywords T1
WHERE T1.keyword_id IN ( ? )  AND t0.id = T1.asset_id


So back to plan B for now: If I specify raw SQL for a FetchSpec in EOModeler, how can I specify named bindings?


Timo

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden

_______________________________________________ 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: 
 >Qualifiers, many-to-many and horizontal inheritance (From: Timo Hoepfner <email@hidden>)
 >Re: Qualifiers, many-to-many and horizontal inheritance (From: Chuck Hill <email@hidden>)
 >Re: Qualifiers, many-to-many and horizontal inheritance (From: Timo Hoepfner <email@hidden>)

  • Prev by Date: Re: WWDC Security concern
  • Next by Date: T-shirts at WWDC?
  • Previous by thread: Re: Qualifiers, many-to-many and horizontal inheritance
  • Next by thread: Having trouble with WOFileUpload
  • Index(es):
    • Date
    • Thread