• 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: Prefetching flattened relationships: Possible WONDER or WO5.4.3 problem (exception)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prefetching flattened relationships: Possible WONDER or WO5.4.3 problem (exception)


  • Subject: Re: Prefetching flattened relationships: Possible WONDER or WO5.4.3 problem (exception)
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 23 Sep 2008 14:00:11 -0700


On Sep 23, 2008, at 11:24 AM, Sergio Sánchez Maffet wrote:

Hi all,

I have noticed a failure in the handling of prefetched flattened relationships using WONDER (latest) with WO 5.4.3

In general, I would describe pre-fetching as buggy. It works in simple cases, but gets confused if you go beyond that.


Consider switching to ERXBatchFetchUtilities.


Model:
My1Entity (class My1Entity)
To one relationships: my3entity destination My3Entity
To many relationships: my2entities (flattened relationship) destination My2Entity


My2Entity (class My2Entity)
To many relationships: my1entities (flattened relationship) destination My1Entity


MyJoinEntity (EOGenericRecord, not visible)
To one relationships: my1Entity destination My1Entity, my2Entity destination My2Entity


My3Entity (class My3Entity)
To many relationships: my1entities destination My1Entity

Now I want to fetch My1Entity objects, with the following qualifier: "my3entity = %@", new NSArray<My3Entity>(a3EntityObject)

If you fetch now, there is no problem.
But if you set to prefetch my2entities (!) of My1Entity with setPrefetchingRelationshipKeyPaths(new NSArray<String>("my2entities")) you got an exception like this one:


java.lang.IllegalStateException: sqlStringForKeyValueQualifier: attempt to generate SQL for com.webobjects.eocontrol.EOKeyValueQualifier (my1Entity. my3entity = (MyEO2)'...') failed because attribute identified by key 'my1Entity. my3entity' was not reachable from from entity 'MyJoinEntity'

One thing I notice is that there seems to be a space between "my1Entity." and "my3entity". Is that from copy and paste, or is that in your model?




This completely is weird, my1Entity. my3entity is reachable from MyJoinEntity (EOGenericRecord),
but the attribute identified by key 'my1Entity. my3entity' is not an attribute/key but a key path!

I am not sure if that is the problem or just a poorly written message.


Until now, I have not done any further investigations... it was working without WONDER and WO 5.4.2 and .3

Is it obligatory to use ERXGenericRecord?
Any clues?


ERXGenericRecord should not be affecting this.

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







_______________________________________________ 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: 
 >Prefetching flattened relationships: Possible WONDER or WO5.4.3 problem (exception) (From: Sergio Sánchez Maffet <email@hidden>)

  • Prev by Date: Prefetching flattened relationships: Possible WONDER or WO5.4.3 problem (exception)
  • Next by Date: Pre-Fetching and To-Manys
  • Previous by thread: Prefetching flattened relationships: Possible WONDER or WO5.4.3 problem (exception)
  • Next by thread: Pre-Fetching and To-Manys
  • Index(es):
    • Date
    • Thread