Class Configuration


  • public class Configuration
    extends Object
    configuration properties that may appear in persistence.xml
    Author:
    Scott Marlow
    • Field Detail

      • PROVIDER_MODULE

        public static final String PROVIDER_MODULE
        name of the AS module that contains the persistence provider
        See Also:
        Constant Field Values
      • PROVIDER_MODULE_HIBERNATE

        public static final String PROVIDER_MODULE_HIBERNATE
        Hibernate main module (default) persistence provider
        See Also:
        Constant Field Values
      • PROVIDER_MODULE_HIBERNATE4_1

        public static final String PROVIDER_MODULE_HIBERNATE4_1
        Hibernate 4.1.x persistence provider, note that Hibernate 4.1.x is expected to be in the 4.1 slot
        See Also:
        Constant Field Values
      • PROVIDER_MODULE_HIBERNATE_OGM

        public static final String PROVIDER_MODULE_HIBERNATE_OGM
        Hibernate OGM persistence provider
        See Also:
        Constant Field Values
      • PROVIDER_MODULE_DEFAULT

        public static final String PROVIDER_MODULE_DEFAULT
        default if no PROVIDER_MODULE is specified.
        See Also:
        Constant Field Values
      • PROVIDER_CLASS_HIBERNATE4_1

        public static final String PROVIDER_CLASS_HIBERNATE4_1
        Hibernate 4.1.x persistence provider class
        See Also:
        Constant Field Values
      • PROVIDER_CLASS_HIBERNATE

        public static final String PROVIDER_CLASS_HIBERNATE
        Hibernate 4.3.x persistence provider class
        See Also:
        Constant Field Values
      • PROVIDER_CLASS_HIBERNATE_OGM

        public static final String PROVIDER_CLASS_HIBERNATE_OGM
        Hibernate OGM persistence provider class
        See Also:
        Constant Field Values
      • PROVIDER_CLASS_TOPLINK_ESSENTIALS

        public static final String PROVIDER_CLASS_TOPLINK_ESSENTIALS
        TopLink provider class names
        See Also:
        Constant Field Values
      • PROVIDER_CLASS_ECLIPSELINK

        public static final String PROVIDER_CLASS_ECLIPSELINK
        EclipseLink provider class name
        See Also:
        Constant Field Values
      • PROVIDER_CLASS_DATANUCLEUS

        public static final String PROVIDER_CLASS_DATANUCLEUS
        DataNucleus provider
        See Also:
        Constant Field Values
      • PROVIDER_CLASS_DATANUCLEUS_GAE

        public static final String PROVIDER_CLASS_DATANUCLEUS_GAE
        DataNucleus provider GAE
        See Also:
        Constant Field Values
      • PROVIDER_MODULE_APPLICATION_SUPPLIED

        public static final String PROVIDER_MODULE_APPLICATION_SUPPLIED
        if the PROVIDER_MODULE is this value, it is expected that the application has its own provider in the deployment.
        See Also:
        Constant Field Values
      • ADAPTER_MODULE

        public static final String ADAPTER_MODULE
        name of the AS module that contains the persistence provider adapter
        See Also:
        Constant Field Values
      • JPA_CONTAINER_MANAGED

        public static final String JPA_CONTAINER_MANAGED
        defaults to true, if changed to false (in the persistence.xml), the Jakarta Persistence container will not start the persistence unit service.
        See Also:
        Constant Field Values
      • JPA_CONTAINER_CLASS_TRANSFORMER

        public static final String JPA_CONTAINER_CLASS_TRANSFORMER
        defaults to true, if false, persistence unit will not support jakarta.persistence.spi.ClassTransformer Interface which means no application class rewriting
        See Also:
        Constant Field Values
      • JPA_ALLOW_TWO_PHASE_BOOTSTRAP

        public static final String JPA_ALLOW_TWO_PHASE_BOOTSTRAP
        set to false to force a single phase persistence unit bootstrap to be used (default is true which uses two phases to start the persistence unit).
        See Also:
        Constant Field Values
      • ADAPTER_CLASS

        public static final String ADAPTER_CLASS
        name of the persistence provider adapter class
        See Also:
        Constant Field Values
      • HIBERNATE_SEARCH_MODULE

        public static final String HIBERNATE_SEARCH_MODULE
        name of the Hibernate Search module name configuration setting in persistence unit definition
        See Also:
        Constant Field Values
      • HIBERNATE_SEARCH_MODULE_MAPPER_ORM

        public static final String HIBERNATE_SEARCH_MODULE_MAPPER_ORM
        name of the Hibernate Search module providing the ORM mapper
        See Also:
        Constant Field Values
      • HIBERNATE_SEARCH_MODULE_MAPPER_ORM_COORDINATION_OUTBOXPOLLING

        public static final String HIBERNATE_SEARCH_MODULE_MAPPER_ORM_COORDINATION_OUTBOXPOLLING
        name of the Hibernate Search module providing the outbox-polling coordination strategy
        See Also:
        Constant Field Values
      • HIBERNATE_SEARCH_MODULE_BACKEND_LUCENE

        public static final String HIBERNATE_SEARCH_MODULE_BACKEND_LUCENE
        name of the Hibernate Search module providing the Lucene backend
        See Also:
        Constant Field Values
      • HIBERNATE_SEARCH_MODULE_BACKEND_ELASTICSEARCH

        public static final String HIBERNATE_SEARCH_MODULE_BACKEND_ELASTICSEARCH
        name of the Hibernate Search module providing the Elasticsearch backend
        See Also:
        Constant Field Values
      • HIBERNATE_SEARCH_BACKEND_TYPE

        public static final String HIBERNATE_SEARCH_BACKEND_TYPE
        name of the Hibernate Search configuration property allowing to set the backend type
        See Also:
        Constant Field Values
      • HIBERNATE_SEARCH_COORDINATION_STRATEGY

        public static final String HIBERNATE_SEARCH_COORDINATION_STRATEGY
        Name of the Hibernate Search configuration property allowing to set the coordination strategy
        See Also:
        Constant Field Values
    • Constructor Detail

      • Configuration

        public Configuration()
    • Method Detail

      • getProviderModuleNameFromProviderClassName

        public static String getProviderModuleNameFromProviderClassName​(String providerClassName)
        Get the provider module name for the specified provider class.
        Parameters:
        providerClassName - the PU class name
        Returns:
        provider module name or null if not known
      • needClassFileTransformer

        public static boolean needClassFileTransformer​(PersistenceUnitMetadata pu)
        Determine if class file transformer is needed for the specified persistence unit if the persistence provider is Hibernate and use_class_enhancer is not true, don't need a class transformer. for other persistence providers, the transformer is assumed to be needed.
        Parameters:
        pu - the PU
        Returns:
        true if class file transformer support is needed for pu
      • getProviderAdapterModuleNameFromProviderClassName

        public static String getProviderAdapterModuleNameFromProviderClassName​(String providerClassName)
      • getDefaultProviderModuleName

        public static String getDefaultProviderModuleName()
      • allowTwoPhaseBootstrap

        public static boolean allowTwoPhaseBootstrap​(PersistenceUnitMetadata pu)
        Determine if two phase persistence unit start is allowed
        Parameters:
        pu -
        Returns:
      • allowApplicationDefinedDatasource

        public static boolean allowApplicationDefinedDatasource​(PersistenceUnitMetadata pu)
        Determine if persistence unit can use application defined DataSource (e.g. DataSourceDefinition or resource ref).
        Parameters:
        pu -
        Returns:
        true if application defined DataSource can be used, false (default) if not.
      • allowDefaultDataSourceUse

        public static boolean allowDefaultDataSourceUse​(PersistenceUnitMetadata pu)
        Determine if the default data-source should be used
        Parameters:
        pu -
        Returns:
        true if the default data-source should be used
      • deferEntityDetachUntilClose

        public static boolean deferEntityDetachUntilClose​(Map<String,​Object> properties)
        Return true if detaching of managed entities should be deferred until the entity manager is closed. Note: only applies to transaction scoped entity managers used without an active Jakarta Transactions transaction.
        Parameters:
        properties -
        Returns:
      • skipQueryDetach

        public static boolean skipQueryDetach​(Map<String,​Object> properties)
        Return true if detaching of query results (entities) should be deferred until the entity manager is closed. Note: only applies to transaction scoped entity managers used without an active Jakarta Transactions transaction.
        Parameters:
        properties -
        Returns:
      • skipMixedSynchronizationTypeCheck

        public static boolean skipMixedSynchronizationTypeCheck​(jakarta.persistence.EntityManagerFactory emf,
                                                                Map targetEntityManagerProperties)
        Allow the mixed synchronization checking to be skipped for backward compatibility with WildFly 10.1.0
        Parameters:
        emf -
        targetEntityManagerProperties -
        Returns:
      • allowJoinedUnsyncPersistenceContext

        public static boolean allowJoinedUnsyncPersistenceContext​(jakarta.persistence.EntityManagerFactory emf,
                                                                  Map targetEntityManagerProperties)
        Allow an unsynchronized persistence context that is joined to the transaction, be treated the same as a synchronized persistence context, with respect to the checking for mixed unsync/sync types.
        Parameters:
        emf -
        targetEntityManagerProperties -
        Returns: