Class PersistenceConfiguration


  • public class PersistenceConfiguration
    extends Object
    Represents a configuration of a persistence unit, allowing programmatic creation of an EntityManagerFactory. The configuration options available via this API reflect the similarly-named elements of the persistence.xml file.

    This API may not be used to configure a container-managed persistence unit. That is, the configured persistence unit should be considered a Java SE persistence unit, even when this API is used within the Jakarta EE environment.

    If injection of the EntityManagerFactory is required, a CDI Producer may be used to make the EntityManagerFactory available as a CDI managed bean. {@snippet :

    Since:
    3.2
    See Also:
    Persistence.createEntityManagerFactory(PersistenceConfiguration)