| Re: [eclipselink-users] Problems with ManyToOne and OneToMany |
Hello Johannes,
JPA does not maintain relationships for you, and instead requires applications to maintain both sides of every relationship so that they remain consistent with what is in the database. What that means here is that when you are deleting a Player, you also need to remove any references that might remain in the object model to the deleted player - in this case remove the player from the players set. If not, Team will reference the removed player until it gets refreshed.
The application has the same issue when you add a player to a team - the application must set both sides of the relationship, or the object model may not reflect what gets set in the database.
Hope this helps.
Chris
----- Original Message -----
From: "Orgler" <orgler@xxxxxxxxx>
To: "Eclipselink-Users" <eclipselink-users@xxxxxxxxxxx>
Sent: Sunday, July 12, 2009 7:19:39 AM GMT -05:00 US/Canada Eastern
Subject: [eclipselink-users] Problems with ManyToOne and OneToMany