Interface JPAManipulations


  • public interface JPAManipulations
    Interface to implement some common manipulations in JPA.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void forceLoad()
      descend through an object tree to force loading of lazily loaded collections.
      void jpaClone​(javax.persistence.EntityManager em)
      Deep clone entity by detaching.
    • 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 manager
            MyEntity to_clone = entityManager.find(MyEntity.class, ID);
            to_clone.jpaClone(entityManager);
            entityManager.merge(to_clone);