• 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: Non Compulsory toOne Relationships, Propergating Primary Key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non Compulsory toOne Relationships, Propergating Primary Key


  • Subject: Re: Non Compulsory toOne Relationships, Propergating Primary Key
  • From: Art Isbell <email@hidden>
  • Date: Thu, 6 Dec 2007 21:50:54 -1000

On Dec 6, 2007, at 8:18 PM, Owen McKerrow wrote:

I have the following relationship :

GROUP <-- --> RQF_GROUP

where a group may have a RQF Group object, but the RQF Group object must belong to a group.

As its a to one I want it to propagate its primary key across, however when I tick this box WO is nice and helpful and inserts a new RQFGroup object every-time I make a new Group, even thought I have specified that the relationship is optional. Is there any way to stop this from happening ?

If I understand correctly, you want the primary key of the RQF_GROUP object to be the same as that of GROUP object.  If so, you can't have an optional to-one relationship in which the foreign key of the GROUP.RQF_GROUP relationship is non-null.  The foreign key of this relationship can't be null because it's the GROUP object primary key.  So WO graciously creates an RQF_GROUP object for you which isn't what you want.

This situation is described in "Tips for Specifying Relationships" in the EOModeler User Guide at <http://developer.apple.com/documentation/WebObjects/UsingEOModeler/5WorkingWithRelationships/chapter_5_section_4.html>:

A to-one relationship from one foreign key to a primary key must always have exactly one row in the destination entity—if this isn’t guaranteed to be the case, use a to-many relationship. This rule doesn’t apply to a foreign key to primary key relationship where a null value for the foreign key in the source row indicates that no row exists in the destination.

Aloha,
Art

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

  • Follow-Ups:
    • Re: Non Compulsory toOne Relationships, Propergating Primary Key
      • From: Chuck Hill <email@hidden>
References: 
 >Non Compulsory toOne Relationships, Propergating Primary Key (From: Owen McKerrow <email@hidden>)

  • Prev by Date: Non Compulsory toOne Relationships, Propergating Primary Key
  • Next by Date: Re: WOLips/Ant: Installing {$project.name} in //Library/Frameworks
  • Previous by thread: Non Compulsory toOne Relationships, Propergating Primary Key
  • Next by thread: Re: Non Compulsory toOne Relationships, Propergating Primary Key
  • Index(es):
    • Date
    • Thread