• 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: How to handle relationship properties?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to handle relationship properties?


  • Subject: Re: How to handle relationship properties?
  • From: Art Isbell <email@hidden>
  • Date: Sun, 1 Jan 2006 13:08:35 -1000

On Jan 1, 2006, at 12:27 PM, Miguel Arroz wrote:

  User user; // Assume this exists
  File file; // Assume this exists

UserFile userFile = giveMeTheRelationhipObjectBetweenTheseTwoObjects(user, file);

What I want to know is how to write the giveMeTheRelationhipObjectBetweenTheseTwoObjects() method! ;)

As was explained previously, you need to modify the many-to-many relationship that EOModeler will create for you so that you can access the join entity (UserFile, in your case). To do this, you need to delete the flattened relationships User.files and File.users and make the underlying relationships User.userFiles, File.userFiles, UserFile.user, and UserFile.file class properties. EOModeler makes the compound primary key of the join entity class properties which is unnecessary, so I always remove these primary keys from the list of class properties. Then I ask EOModeler (or eogenerator) to generate the Java class files so that accessor methods for the new class properties will be created.


	After doing this, the UserFiles related to a User, user:

NSArray userFiles = user.userFiles();

and the UserFiles related to a File, file:

NSArray userFiles = file.userFiles();

Aloha,
Art

_______________________________________________
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: 
 >How to handle relationship properties? (From: Miguel Arroz <email@hidden>)
 >Re: How to handle relationship properties? (From: Arturo PĂ©rez <email@hidden>)
 >Re: How to handle relationship properties? (From: Miguel Arroz <email@hidden>)
 >Re: How to handle relationship properties? (From: Miguel Arroz <email@hidden>)

  • Prev by Date: Re: How to handle relationship properties?
  • Next by Date: Re: How to handle relationship properties?
  • Previous by thread: Re: How to handle relationship properties?
  • Next by thread: Re: How to handle relationship properties?
  • Index(es):
    • Date
    • Thread