• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
babak behzadi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!