Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wrong value on merge()

 
David de Lucca
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!

I have a problem with an attribute:

son entity


main entity


My dao does "this.getEntityManager().persist(main);" or "this.getEntityManager().merge(playlist);" ... i dont know why but when gonna persist, the values from "order" are changed by "sons.size() + 1" for each object inside List<Sons>. Example: if i set value 1 for object1, and value 2 for object2. when i call persist() or merge(), new values are 3 for object1 and and 4 for object2.


Whats wrong?

Thanks.

padcoe
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show the logic which set those values? And your main code where you compose the object graph to be persisted?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic