Hi everyone,
I am facing a problem that I was not able to solve on my own, thus I ask for your help. I have an entity class which is almost a POJO, containing several properties which should be considered by the persistence provider but I also have another property in the entity class which is a collection and which is annotated as transient.
As soon as I try to merge such a detached entity, the collection - which was non-empty before the merge - becomes empty right after the merge. This is a behaviour that I do not understand and which causes unwanted side effects, because I need to store the entity before processing any further, because I need its ID in order to save the entities that are stored in the collection.
Just in case that you suggest to let the JPA do the dirty work - this is not possible here because some of the entities need transformation prior to persisting.
Could anyone explain this behaviour?
Thank a lot,
Florian
|