Class XEntityManagerUtils


  • public final class XEntityManagerUtils
    extends Object
    Utility class for EntityManagers.
    Since:
    8.3.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • detachEntityIfPresent

        public static void detachEntityIfPresent​(javax.persistence.EntityManager em,
                                                 Object entity)
        Attempts to detach the entity from the entity manager, if it contains the entity.
        Parameters:
        em - The entity manager on which to operate.
        entity - The entity to detach.
      • detachEntityIfPresent

        public static void detachEntityIfPresent​(javax.persistence.EntityManager em,
                                                 Class<?> entityType,
                                                 Object primaryKey)
        Attempts to detach the entity from the entity manager, if it contains the entity.
        Parameters:
        em - The entity manager on which to operate.
        entityType - The type of the entity.
        primaryKey - The primary key of the entity.