Class XEntityManagerUtils

java.lang.Object
de.xima.fc.dao.utils.XEntityManagerUtils

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

    • 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.