类 ExtendedEntityManagerCreator

    • 方法详细资料

      • createApplicationManagedEntityManager

        public static EntityManager createApplicationManagedEntityManager​(EntityManager rawEntityManager,
                                                                          EntityManagerFactoryInfo emfInfo)
        Create an application-managed extended EntityManager proxy.
        参数:
        rawEntityManager - the raw EntityManager to decorate
        emfInfo - the EntityManagerFactoryInfo to obtain the JpaDialect and PersistenceUnitInfo from
        返回:
        an application-managed EntityManager that can join transactions but does not participate in them automatically
      • createApplicationManagedEntityManager

        public static EntityManager createApplicationManagedEntityManager​(EntityManager rawEntityManager,
                                                                          EntityManagerFactoryInfo emfInfo,
                                                                          boolean synchronizedWithTransaction)
        Create an application-managed extended EntityManager proxy.
        参数:
        rawEntityManager - the raw EntityManager to decorate
        emfInfo - the EntityManagerFactoryInfo to obtain the JpaDialect and PersistenceUnitInfo from
        synchronizedWithTransaction - whether to automatically join ongoing transactions (according to the JPA 2.1 SynchronizationType rules)
        返回:
        an application-managed EntityManager that can join transactions but does not participate in them automatically
        从以下版本开始:
        4.0
      • createContainerManagedEntityManager

        public static EntityManager createContainerManagedEntityManager​(EntityManager rawEntityManager,
                                                                        EntityManagerFactoryInfo emfInfo)
        Create a container-managed extended EntityManager proxy.
        参数:
        rawEntityManager - the raw EntityManager to decorate
        emfInfo - the EntityManagerFactoryInfo to obtain the JpaDialect and PersistenceUnitInfo from
        返回:
        a container-managed EntityManager that will automatically participate in any managed transaction
      • createContainerManagedEntityManager

        public static EntityManager createContainerManagedEntityManager​(EntityManagerFactory emf)
        Create a container-managed extended EntityManager proxy.
        参数:
        emf - the EntityManagerFactory to create the EntityManager with. If this implements the EntityManagerFactoryInfo interface, the corresponding JpaDialect and PersistenceUnitInfo will be detected accordingly.
        返回:
        a container-managed EntityManager that will automatically participate in any managed transaction
        另请参阅:
        EntityManagerFactory.createEntityManager()
      • createContainerManagedEntityManager

        public static EntityManager createContainerManagedEntityManager​(EntityManagerFactory emf,
                                                                        Map<?,​?> properties)
        Create a container-managed extended EntityManager proxy.
        参数:
        emf - the EntityManagerFactory to create the EntityManager with. If this implements the EntityManagerFactoryInfo interface, the corresponding JpaDialect and PersistenceUnitInfo will be detected accordingly.
        properties - the properties to be passed into the createEntityManager call (may be null)
        返回:
        a container-managed EntityManager that will automatically participate in any managed transaction
        另请参阅:
        EntityManagerFactory.createEntityManager(java.util.Map)
      • createContainerManagedEntityManager

        public static EntityManager createContainerManagedEntityManager​(EntityManagerFactory emf,
                                                                        Map<?,​?> properties,
                                                                        boolean synchronizedWithTransaction)
        Create a container-managed extended EntityManager proxy.
        参数:
        emf - the EntityManagerFactory to create the EntityManager with. If this implements the EntityManagerFactoryInfo interface, the corresponding JpaDialect and PersistenceUnitInfo will be detected accordingly.
        properties - the properties to be passed into the createEntityManager call (may be null)
        synchronizedWithTransaction - whether to automatically join ongoing transactions (according to the JPA 2.1 SynchronizationType rules)
        返回:
        a container-managed EntityManager that expects container-driven lifecycle management but may opt out of automatic transaction synchronization
        从以下版本开始:
        4.0
        另请参阅:
        EntityManagerFactory.createEntityManager(java.util.Map)