| In the process of persisting a collection, Hibernate wraps the actual collection in an implementation of PersistentCollection, in this case PersistentMap, then substitutes that collection in the entity with the wrapped collection by calling the property setter. In your case, the setter is called with the PersistentMap as an argument. Your method then clears the entity's existing collection. Since the PersistentMap wraps that collection, it also becomes empty, so there is no data to copy back into your collection. As mentioned in the user doc in 2.8 Collections: "Hibernate uses its own collection implementations which are enriched with lazy-loading, caching or state change detection semantics." Your setter should simply assign the argument to the field. |