Hi,

 

I'm using OpenJPA 2.1.0 and make use of the @ElementDependent annotation.
Recently I discovered following unexpected behaviour.

 

I have an entity that contains a collection of dependent elements. When I
load the entity in the persistence context, make changes on some of its
attributes (but not on the dependend elements collection) and merge the
entity, then the dependent elements are deleted upon the transaction commit.
As the entity is already managed the merge should actually do nothing. The
loading of the dependent elements collection is lazy and I haven't loaded
any of them, but the dependend elements were not removed from the collection
and should be referenced at the time of commit, so I would expect them to be
retained. Is it a bug or a feature?

 

Kind regards,

Michael.

 

Reply via email to