Louis, One-to-one relationships are interesting beasts in EOF. It seems to have something to do with EOF's primary key generation. Since a one-to-one relationship connects the PK of one table to the PK of another table you don't want EOF to try to generate keys for both sides. It is possible to set one side of the relationship to propagate it's primary key to the other side. Doing so will tell EOF to generate one PK and then propagate that key to the other object. The effect of this is that both objects are always created (both tables with have the same number of rows with PK matches for each row), so you may end up with a lot of rows in one table, even if you don't need them. This is probably fine as long as your tables aren't huge and you are using a reasonably modern RDBMS. One workaround for this is to use a one-to-many relationship and add validation logic to ensure that only one object can exist on the many side. Now you can treat this like a one-to-one without creating unused rows on one side. Additionally you can add a "cover" method that returns the first (and only) object from the many side. --Robert Walker There are 10 types of people in the world, those who count in binary, and those who don't. On Mar 22, 2006, at 1:06 AM, Louis Demers wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]
