• 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
A few basic questions about EOF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A few basic questions about EOF


  • Subject: A few basic questions about EOF
  • From: Paulo Filipe Andrade <email@hidden>
  • Date: Tue, 24 Mar 2009 17:07:17 +0000

Imagine the following model, where a User has a many to many relationship with Message. A user can have many messages and messages can be read by many users.

User <<----------->> Message

I can model this in EOModeler as a flattened relationship, and as expected this will create the many-to-many indirection table UserMessage for me.

User <------>> UserMessage <<----> Message

In the User entity it creates a relationship property messages() that allows me to bypass the indirection table (and users() in Messages).

Now for the questions:

1 ==
In the "deprecated" EOModeler User Guide it states:
" Primary key propagation is also commonly used to generate primary keys for join tables in many-to-many relationships."


If the join table has a compound primary key (consisting of the two foreign keys to User and Message), how does this apply?

2 ==
Does anybody know how does WebObjects manage flattened relationships internally?
Basically I want to know if (besides having more readable code) I get some performance improvements using this.
So which are there any performance differences in these two?


user.messages();
or
user.userMessages().valueForKey("message");


3 ==
Now imagine I need to know if a user has read a message. I would simply add a boolean to the indirection table to store this.
Can I still use the flattened relationships WebObjects provides and store this boolean in the indirection table?
Are there any caveats I should be aware of?


4 ==

Theoretically if a message has no relation to users, it should be deleted.
Does Owns Destination work in this many-to-many scenario?


5 ==

Not directly related to this scenario but I still couldn't quite figure out:

When doing a addObjectToBothSideOfRelationship how does EOF know which relationship is the inverse relationship?
In Core Data this is explicitly set but not in EOF.




Sorry if this was a bit too long, but I'm trying to tie up loose ends in my mental model of EOF.

Thank you for your time,
Paulo F. Andrade






_______________________________________________ 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: A few basic questions about EOF
      • From: David Avendasora <email@hidden>
  • Prev by Date: Ajax inside a Repetition
  • Next by Date: Re: Change rewriteURL
  • Previous by thread: Re: Ajax inside a Repetition
  • Next by thread: Re: A few basic questions about EOF
  • Index(es):
    • Date
    • Thread