Package org.hibernate.jpa
Class HibernatePersistenceConfiguration
java.lang.Object
jakarta.persistence.PersistenceConfiguration
org.hibernate.jpa.HibernatePersistenceConfiguration
Hibernate extension to the Jakarta Persistence
PersistenceConfiguration
contract.- Since:
- 7.0
-
Field Summary
Fields inherited from class jakarta.persistence.PersistenceConfiguration
CACHE_MODE, JDBC_DATASOURCE, JDBC_DRIVER, JDBC_PASSWORD, JDBC_URL, JDBC_USER, LOCK_TIMEOUT, QUERY_TIMEOUT, SCHEMAGEN_CREATE_SCRIPT_SOURCE, SCHEMAGEN_CREATE_SOURCE, SCHEMAGEN_CREATE_TARGET, SCHEMAGEN_DATABASE_ACTION, SCHEMAGEN_DROP_SCRIPT_SOURCE, SCHEMAGEN_DROP_SOURCE, SCHEMAGEN_DROP_TARGET, SCHEMAGEN_SCRIPTS_ACTION, VALIDATION_FACTORY, VALIDATION_GROUP_PRE_PERSIST, VALIDATION_GROUP_PRE_REMOVE, VALIDATION_GROUP_PRE_UPDATE
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new empty configuration. -
Method Summary
Modifier and TypeMethodDescriptioncaching
(CachingType type) Enable/disable Hibernate's caching supportcachingAccessType
(AccessType type) If data caching is enabled, configure the type of concurrency access that should be applied if not explicitly specified on a cache region.cachingCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for handling of proxies.closedCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for handling around calls to EntityManager.close(), EntityManager.isOpen(), EntityManagerFactory.close() and EntityManagerFactory.isOpen()collectStatistics
(boolean enabled) Configures whether Hibernate should collect Statistics.defaultCatalog
(String catalogName) Configure a default catalog name to be used for database objects (tables, sequences, etc) which do not explicitly specify one.defaultSchema
(String schemaName) Configure a default schema name to be used for database objects (tables, sequences, etc) which do not explicitly specify one.globalGeneratorCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for in terms of collecting all named value generators globally, regardless of location.jdbcDriver
(String driverName) Name of the JDBC driver to use for non-Datasource connectionjdbcPassword
(String password) User-name to use for non-Datasource JDBC connectionURL to use for non-Datasource JDBC connectionjdbcUsername
(String username) User-name to use for non-Datasource JDBC connectionjtaDataSource
(String dataSourceJndiName) loadByIdCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for the allowed type of identifier value passed toEntityManager.getReference(java.lang.Class<T>, java.lang.Object)
andEntityManager.find(java.lang.Class<T>, java.lang.Object)
managedClass
(Class<?> managedClass) managedClasses
(Class<?>... managedClasses) Add the specified classes as managed classes.managedClasses
(Collection<Class<?>> managedClasses) Add the specified classes as managed classes.mappingFile
(String name) mappingFiles
(String... names) Add the specified resource names as mapping files.mappingFiles
(Collection<String> names) Add the specified resource names as mapping files.nationalizedCharacterData
(boolean enabled) Configure a default schema name to be used for database objects (tables, sequences, etc) which do not explicitly specify one.nonJtaDataSource
(String dataSourceJndiName) orderByMappingCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for the interpretation ofOrderBy
.properties
(Map<String, ?> properties) proxyCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for handling of proxies.queryCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for all aspects of Query handling.schemaToolingAction
(Action action) Specify the action to take in terms of automatic database schema tooling.sharedCacheMode
(SharedCacheMode sharedCacheMode) statementInspector
(Class<? extends StatementInspector> inspectorImpl) Specify a StatementInspector to be applied to all Sessions/EntityManagersstatementInspector
(StatementInspector inspector) Specify a StatementInspector to be applied to all Sessions/EntityManagerstransactionCompliance
(boolean enabled) Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for all aspects of transaction handling.transactionType
(PersistenceUnitTransactionType transactionType) validationMode
(ValidationMode validationMode) xmlMappings
(boolean enabled) Configures whether Hibernate should process XML mappings (orm.xml
files).xmlValidation
(boolean enabled) Configures whether Hibernate should validate (via schema descriptor) XML files.Methods inherited from class jakarta.persistence.PersistenceConfiguration
jtaDataSource, managedClasses, mappingFiles, name, nonJtaDataSource, properties, provider, sharedCacheMode, transactionType, validationMode
-
Constructor Details
-
HibernatePersistenceConfiguration
Create a new empty configuration. An empty configuration does not typically hold enough information for successful invocation ofcreateEntityManagerFactory()
.- Parameters:
name
- the name of the persistence unit, which may be used by the persistence provider for logging and error reporting
-
-
Method Details
-
createEntityManagerFactory
- Overrides:
createEntityManagerFactory
in classPersistenceConfiguration
-
jdbcDriver
Name of the JDBC driver to use for non-Datasource connection- See Also:
-
jdbcUrl
URL to use for non-Datasource JDBC connection- See Also:
-
jdbcUsername
User-name to use for non-Datasource JDBC connection -
jdbcPassword
User-name to use for non-Datasource JDBC connection -
queryCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for all aspects of Query handling. -
transactionCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for all aspects of transaction handling. -
closedCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for handling around calls to EntityManager.close(), EntityManager.isOpen(), EntityManagerFactory.close() and EntityManagerFactory.isOpen() -
proxyCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for handling of proxies. -
cachingCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for handling of proxies. -
globalGeneratorCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for in terms of collecting all named value generators globally, regardless of location. -
orderByMappingCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for the interpretation ofOrderBy
. -
loadByIdCompliance
Defines whether Hibernate will strictly adhere to compliance with Jakarta Persistence for the allowed type of identifier value passed toEntityManager.getReference(java.lang.Class<T>, java.lang.Object)
andEntityManager.find(java.lang.Class<T>, java.lang.Object)
-
caching
Enable/disable Hibernate's caching support -
cachingAccessType
If data caching is enabled, configure the type of concurrency access that should be applied if not explicitly specified on a cache region. -
statementInspector
public HibernatePersistenceConfiguration statementInspector(Class<? extends StatementInspector> inspectorImpl) Specify a StatementInspector to be applied to all Sessions/EntityManagers- See Also:
-
statementInspector
Specify a StatementInspector to be applied to all Sessions/EntityManagers- See Also:
-
defaultCatalog
Configure a default catalog name to be used for database objects (tables, sequences, etc) which do not explicitly specify one.- See Also:
-
defaultSchema
Configure a default schema name to be used for database objects (tables, sequences, etc) which do not explicitly specify one.- See Also:
-
nationalizedCharacterData
Configure a default schema name to be used for database objects (tables, sequences, etc) which do not explicitly specify one. -
xmlMappings
Configures whether Hibernate should process XML mappings (orm.xml
files).- See Also:
-
xmlValidation
Configures whether Hibernate should validate (via schema descriptor) XML files.- See Also:
-
collectStatistics
Configures whether Hibernate should collect Statistics.- See Also:
-
managedClasses
Add the specified classes as managed classes.- See Also:
-
managedClasses
Add the specified classes as managed classes.- See Also:
-
mappingFiles
Add the specified resource names as mapping files.- See Also:
-
mappingFiles
Add the specified resource names as mapping files.- See Also:
-
schemaToolingAction
Specify the action to take in terms of automatic database schema tooling.- See Also:
- API Note:
- This only controls tooling as exported directly to the database. To output tooling commands to scripts, use config properties instead with appropriate settings.
-
provider
- Overrides:
provider
in classPersistenceConfiguration
-
jtaDataSource
- Overrides:
jtaDataSource
in classPersistenceConfiguration
-
nonJtaDataSource
- Overrides:
nonJtaDataSource
in classPersistenceConfiguration
-
managedClass
- Overrides:
managedClass
in classPersistenceConfiguration
-
mappingFile
- Overrides:
mappingFile
in classPersistenceConfiguration
-
transactionType
public HibernatePersistenceConfiguration transactionType(PersistenceUnitTransactionType transactionType) - Overrides:
transactionType
in classPersistenceConfiguration
-
validationMode
- Overrides:
validationMode
in classPersistenceConfiguration
-
property
- Overrides:
property
in classPersistenceConfiguration
-
properties
- Overrides:
properties
in classPersistenceConfiguration
-