The moose likes Object Relational Mapping and the fly likes wrong value on merge() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "wrong value on merge()" Watch "wrong value on merge()" New topic
Author

wrong value on merge()

David de Lucca
Greenhorn

Joined: Aug 25, 2009
Posts: 10
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

Joined: Mar 24, 2008
Posts: 3563

Can you show the logic which set those values? And your main code where you compose the object graph to be persisted?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
 
subject: wrong value on merge()
 
Threads others viewed
jaxb marshall java to xml
Inheritance and incomptaible casting
Map Cascade delete
GC
Key already exists exception
MyEclipse, The Clear Choice