Interface EntityManagerProvider

All Known Implementing Classes:
ContainerManagedEntityManagerProvider, FactoryBasedEntityManagerProvider, SimpleEntityManagerProvider

@Internal public interface EntityManagerProvider
Provides components with an EntityManager to access the persistence mechanism. Depending on the application environment, this may be a single container managed EntityManager, or an application managed instance for one-time use.

Note that the implementation is responsible for keeping track of transaction scope, if necessary. Generally, this is the case when using application-managed EntityManagers.

Since:
1.3
Author:
Allard Buijze
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.persistence.EntityManager
    Returns the EntityManager instance to use.
  • Method Details

    • getEntityManager

      jakarta.persistence.EntityManager getEntityManager()
      Returns the EntityManager instance to use.

      Note that the implementation is responsible for keeping track of transaction scope, if necessary. Generally, this is the case when using application-managed EntityManagers.

      Returns:
      the EntityManager instance to use.