Package org.ivoa.vodml.jpa
Interface JPAManipulations
-
- All Known Subinterfaces:
JPAManipulationsForObjectType<ID>
public interface JPAManipulationsInterface to implement some common manipulations in JPA.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidforceLoad()descend through an object tree to force loading of lazily loaded collections.voidjpaClone(javax.persistence.EntityManager em)Deep clone entity by detaching.voidpersistRefs(javax.persistence.EntityManager em)Persist any references in the object tree.
-
-
-
Method Detail
-
forceLoad
void forceLoad()
descend through an object tree to force loading of lazily loaded collections.
-
jpaClone
void jpaClone(javax.persistence.EntityManager em)
Deep clone entity by detaching. Note that references are left alone.- Parameters:
em- the entity managerMyEntity to_clone = entityManager.find(MyEntity.class, ID); to_clone.jpaClone(entityManager); entityManager.merge(to_clone);
-
persistRefs
void persistRefs(javax.persistence.EntityManager em)
Persist any references in the object tree. This exists to aid initial persistence of a model instance, as no JPA operations (apart from refresh) are cascaded to references. References lifecycle is expected to be managed separately.- Parameters:
em- the entity manager
-
-