• 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: objectsWithFetchSpecification appears to not do a deep fetch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objectsWithFetchSpecification appears to not do a deep fetch


  • Subject: Re: objectsWithFetchSpecification appears to not do a deep fetch
  • From: Baiss Eric Magnusson <email@hidden>
  • Date: Wed, 31 Mar 2004 20:00:04 -0800

Well, the record is for sure in the DB.
Why doesn't the <objectsWithFetchSpecification> deep fetch the <Presenter> relationship entities, which are linked to in the model from the <Event> table?
The join I specify for in the relationship is <Inner> which is the default join.
The constructor <new EOFetchSpecification( "Event", null, sortOrderings );> defines the Entity to be an <Event>.


The problem is maybe more convoluted, I did a
Presenter theEventPresenter = eventItem.toPresenter();
right after the original <saveChanges> call for a new event and I got the object.


I could force the loading of the object by accessing the foreign key from the <Event> object and do a fetch of the <Presenter> using that key, but that seems really awkward.

Thanks for helping,
Baiss

PS: hope the book is coming along fine.

On Mar 31, 2004, at 7:21 PM, Chuck Hill wrote:

That error is what I would expect to see if a eo was not in an ec (ec had been garbage collected, object has been deleted out of ec, object not yet inserted into ec). Any chance that the problem lies in one of those areas?

Chuck


On Mar 31, 2004, at 6:45 PM, Baiss Eric Magnusson wrote:

I create a complicated fetch spec with qualifier and call:

	fetchSpec = new EOFetchSpecification( "Event", null, sortOrderings );
	clientSearch = new EOAndQualifier( qualifierAndArray );
	fetchSpec.setQualifier( clientSearch );
	NSArray objsForMonth = ec.objectsWithFetchSpecification( fetchSpec );

But when I try to reference a one-to-one relationship from one of the fetched <eventItem's> in the NSArray (I know the foreign keys will find a match):

	Presenter theEventPresenter = eventItem.toPresenter();

I get <java.lang.NullPointerException>:
at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomO bject.java:1293)
...eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericReco rdBinding.valueInObject(_EOMutableKnownKeyDictionary.java:560)
at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObje ct.java:1736)


----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >objectsWithFetchSpecification appears to not do a deep fetch (From: Baiss Eric Magnusson <email@hidden>)
 >Re: objectsWithFetchSpecification appears to not do a deep fetch (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: objectsWithFetchSpecification appears to not do a deep fetch
  • Previous by thread: Re: objectsWithFetchSpecification appears to not do a deep fetch
  • Index(es):
    • Date
    • Thread