This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Problem, add new records in a many-to-many relation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem, add new records in a many-to-many relation" Watch "Problem, add new records in a many-to-many relation" New topic
Author

Problem, add new records in a many-to-many relation

babak behzadi
Greenhorn

Joined: Sep 02, 2012
Posts: 1
Hi,
I have two entities 'Person' and 'Team' which are mapped by a bidirectional many-to-many relation using annotations, as follow:


,


my service class{1, 2: According to 'Christian Bauer and Gavin King, Java Persistence with Hibernate by Manning Publication Co. Page 301, P 2'}:





And my problem: Calling method 'addTeamToPerson()' does not cause to add a new record to join table 'person_team'!!!
Note: I traced the code line by line, there's no error or exception and the transaction commits.
Please help me solve it.

regards.
babak behzadi
 
Consider Paul's rocket mass heater.
 
subject: Problem, add new records in a many-to-many relation