• 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
Problem with Many-Many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with Many-Many relationship


  • Subject: Problem with Many-Many relationship
  • From: Srinivas Adusumalli <email@hidden>
  • Date: Thu, 02 Nov 2006 21:31:41 +0530

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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem with Many-Many relationship
      • From: Robert Walker <email@hidden>
  • Prev by Date: UK WebObjects Introduction course, Nov 27-Dec 1
  • Next by Date: Re: Problem with Many-Many relationship
  • Previous by thread: UK WebObjects Introduction course, Nov 27-Dec 1
  • Next by thread: Re: Problem with Many-Many relationship
  • Index(es):
    • Date
    • Thread