[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[News.eclipse.technology.eclipselink] Re: JPA: merging + cascade

This should work, merge maintains object identity of the objects being merged in a cascaded merge. As long as the objects you are merging maintain object identity (there is only one copy of the object C, not different copies representing the same object) you should be fine.

If you have two different copies of the same object, then there could be an issue. If the object did not have a primary key assigned, both copies would be persisted as different new objects. If the object did have a primary key assigned, then both copies would be merged into the same object, but which one's state you would end up with would not be obvious.

-- James