Re: Saving entities problem [SOLVED]
Re: Saving entities problem [SOLVED]
- Subject: Re: Saving entities problem [SOLVED]
- From: Jevon Hills <email@hidden>
- Date: Fri, 1 Aug 2003 10:38:08 -0600
I decided to take your last two messages to me and reply to them both
On Thursday, July 31, 2003, at 07:01 AM, Jevon Hills wrote:
> I have set the relationships to propagate the primary key's for all
> three entities, and set to cascade as well. What am I missing???? ;-(
If I recall your ASCII ER diagram, you had one primary key attribute
and three foreign key attributes in the join entity. The primary key
attribute should be deleted. The foreign key attributes should be
primary keys. Did you make these changes?
In the Database I have removed the 'one field pk' and set the three FK
fields as a compound column PK. I have made changes in my EOModel to
reflect this as well.
On Thursday, July 31, 2003, at 03:47 PM, Art Isbell wrote:
> On Thursday, July 31, 2003, at 04:54 AM, Jevon Hills wrote:
>
>> The Join table exists in the DataBase, so EOModeler is not creating
>> the Join.
>
> Are you saying that you're stuck with the "join" entity as it's
> configured in the DB? I put "join" in quotes because with its own
> primary key and conventional foreign keys to the entities being
> joined, it's not a conventional join entity.
>
> If you're stuck with this schema, then you may need to create a new
> join entity object, insert it into your EC, set both sides of its
> three to-one relationship values, and save. I.e, you wouldn't use
> the flattened relationships in User and no primary key values would be
> propagated. The EC should analyze the changes, insert the new User
> first so that it has a primary key value, then insert the "join"
> object with its foreign keys properly set.
>
I think I understand, but would like to confirm by repeating it back.
In the database I have 4 tables (Users, Applications, Permission and
UserApplicationPermission). In the Database the
UserApplicationPermission table has 3 FK's (the PK's of UsersID,
ApplicationsID and PermissionID). At this point I have some say over
the table as to whether or not it has it's own single field PK or we
Use the CompoundField PK.
The Schema wont be changed from this due to other corporate reasons.
I started my WO application, by modeling the database directly, using
the 'join' table in my EOModel as is. If I understand what you are
suggesting. In EOModeler I should create a "Join Entity" which has no
table in the DB. I can instantiate this obj in my code, insert it into
my EditingContext and use it.
Is this Correct?
How do I get this to "write" the data back into the DB?
> Aloha,
> Art
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
>
>
Jevon K. Hills
Developer - Zymeta Media Promotion Systems
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.