Srinivas,

It sounds likely to me that you have a problem in your model configuration.  Did you EOModeler to "Join in many-to-many" or did you set it all up manually?

In any case you must be sure to get the "Propagates Primary Key" setup correctly.  The easiest way to do this is have EOModeler create the "many-to-many" table for you.  Note though that there is some additional manual configuration that you need to do after using the function (basically setting up your database column names and a few other things).  But, at least the relationships are setup correctly so it's a good head start.

Also keep in mind that this feature will create the joining entity (D) in your example.  So just select (A) and (C) then from the menu choose "Join in many-to-many."  If you want just create a new model with two entities and do this so you can see the proper configuration of the relationships.

On Nov 2, 2006, at 11:01 AM, Srinivas Adusumalli wrote:

Hi All,

I am getting the following exception when i try to save my object.

java.lang.NullPointerException
   at com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext(EODatabaseContext.java:6099)
   at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:412)
   at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3165)

Lets say i have an object A which has to-one relationship to B and many-many relationship to C.

now in the EOModeler i created a D entity which acts like a join table between A and C since the relationship between A and C is many - many.so this is wat it looks in the EOModel
      1               *      *                    1
A  -------------> D --------------> C

but i didn't set the to-many relationship from A ---->D as a instance property instead i have flattened the relationship so that i can access C directly from A using A.flattenedRelationship , I made this flattened relationship as a class property.

Now coming back to the problem, once the relationship is established from A--> C if i try to change the relationship from A-->B its throwing the above exception.

if i remove the relationship from A---> D and then try to establish the relationship between A ---> B then i am not getting any error .

if i establish relationship from A---> B and then establish relationship form A-->C then also i am getting any exception only when i establish relationship from A-->C first n then A---> B i am getting the exception.

NOTE : B and C also have relationship in between them. following are the relationships

A to-many B
A many to many C
B to-many C

OR
 1                     *
A----------------> B

 *                     *
A---------------->C

 1                     *
B---------------->C


Any clues why i am getting the exception for the flow mentioned.

Thanks in Advance

Regards,
--Sri

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]

--
Robert Walker



 _______________________________________________
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]

Reply via email to