• 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: Empty relationship that isn't null
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Empty relationship that isn't null


  • Subject: Re: Empty relationship that isn't null
  • From: Ken Anderson <email@hidden>
  • Date: Wed, 18 May 2005 16:23:15 -0400

To expand a little bit on what Chuck is saying, if a value exists in a column being used to construct a relationship, EOF believes that the related object exists. If you use the same primary key for related EO's (for instance, a primary EO, and an optional 'sidecar' object), you can run into this problem, since the primary key of the primary EO always exists, it is expected that the related object always exists.

This occurs often in databases that were designed without EOF in mind. A typical way to work around this is to make the relationship to-many, then have a custom accessor in the EO of the single variety that either returns toMany.firstObject() or nil, depending on whether there's a count on the relationship or not.

Ken

On May 18, 2005, at 4:12 PM, Chuck Hill wrote:

We are talking about a specific object that is related to a specific row in the database. Does that row have a non-null value for the EntityB FK? If so, is it valid or do you have a referential integrity problem in your data? If you have a referential integrity problem (which is what it sounds like), then you are seeing what is called a "Dummy Fault EO" see http:// lists.apple.com/archives/webobjects-dev/2003/Aug/msg00433.html and other Google hits.


Chuck


On May 18, 2005, at 12:46 PM, DevReseune wrote:


Hi,

It's an optional to-one relationship, there is none EntityB in database, and the entityB FK is null by default, but this property is hidden (not the related object, but its ID).

I don't understand.


Frédéric

Le 16 mai 05 à 21:24, Chuck Hill a écrit :


This is a to-one relationship? Is it marked as optional or mandatory? Is the entityB FK in the EntityA object null, or does it have a value?

Chuck

On May 16, 2005, at 11:19 AM, DevReseune wrote:



Hi,

I have 2 entities bound with a relationship:
    - EntityA
        - entityB -> EntityB
    - EntityB

When I fetch an EntityA, the relationship entityB is initialited with an EOAccessDeferredFaultHandler (takeStoredValueForKey) while the SQL select statement returns 0 row.

When I try to access to the relationship entityB, it is updated with an _EOVectorKeyGlobalID (takeStoredValueForKey).

But, I expected a null value. What's the problem?

Webobjects 5.2.4
MacOS X Tiger (I have the same behavior on X.3).



Frédéric _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-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









--
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:
40anderhome.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
  • Follow-Ups:
    • Re: Empty relationship that isn't null
      • From: DevReseune <email@hidden>
References: 
 >Empty relationship that isn't null (From: DevReseune <email@hidden>)
 >Re: Empty relationship that isn't null (From: Chuck Hill <email@hidden>)
 >Re: Empty relationship that isn't null (From: DevReseune <email@hidden>)
 >Re: Empty relationship that isn't null (From: Chuck Hill <email@hidden>)

  • Prev by Date: Display Tag for WO? WOTable on Steroids?
  • Next by Date: Re: Display Tag for WO? WOTable on Steroids?
  • Previous by thread: Re: Empty relationship that isn't null
  • Next by thread: Re: Empty relationship that isn't null
  • Index(es):
    • Date
    • Thread