Top Description Fields
org.hibernate.cfg

public Interface AvailableSettings

extends BatchSettings, BytecodeSettings, CacheSettings, EnvironmentSettings, FetchSettings, JdbcSettings, JpaComplianceSettings, ManagedBeanSettings, MappingSettings, MultiTenancySettings, PersistenceSettings, QuerySettings, SchemaToolingSettings, SessionEventSettings, StatisticsSettings, TransactionSettings, ValidationSettings
Known Direct Implementers
org.hibernate.cfg.Environment
Imports
org.hibernate.CustomEntityDirtinessStrategy, org.hibernate.jpa.LegacySpecHints, .SpecHints

Enumerates the configuration properties supported by Hibernate, including properties defined by the JPA specification.

The settings defined here may be specified at configuration time:

Note that Hibernate does not distinguish between JPA-defined configuration properties and "native" configuration properties. Any property listed here may be used to configure Hibernate no matter what configuration mechanism or bootstrap API is used.

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
CURRENT_SESSION_CONTEXT_CLASS

Specifies a org.hibernate.context.spi.CurrentSessionContext for scoping the current session, either:

  • jta, thread, or managed, or
  • the name of a class implementing org.hibernate.context.spi.CurrentSessionContext.
public static final String
public static final String
public static final String
DISCARD_PC_ON_CLOSE

When enabled, specifies that the persistent context should be discarded when either org.hibernate.Session#close() or jakarta.persistence.EntityManager#close() is called.

public static final String
EVENT_LISTENER_PREFIX

Event listener configuration properties follow the pattern hibernate.event.listener.eventType packageName.ClassName1, packageName.ClassName2

public static final String
FLUSH_MODE

Deprecated for removal since 6.2. There are much better ways to control the flush mode of a session, for example, org.hibernate.SessionBuilder#flushMode or org.hibernate.Session#setHibernateFlushMode.
public static final String
public static final String
IDENTIFIER_GENERATOR_STRATEGY_PROVIDER

Specifies a class which implements org.hibernate.jpa.spi.IdentifierGeneratorStrategyProvider, and has a constructor with no parameters.

public static final String
JAKARTA_LOCK_SCOPE

Set a default value for the hint SpecHints#HINT_SPEC_LOCK_SCOPE, used when the hint is not explicitly specified.

public static final String
JAKARTA_LOCK_TIMEOUT

Set a default value for the hint SpecHints#HINT_SPEC_LOCK_TIMEOUT, used when the hint is not explicitly specified.

public static final String
JPA_LOCK_SCOPE

Deprecated Use JAKARTA_LOCK_SCOPE instead
public static final String
JPA_LOCK_TIMEOUT

Deprecated Use JAKARTA_LOCK_TIMEOUT instead
public static final String
public static final String
MERGE_ENTITY_COPY_OBSERVER

Setting that specifies how Hibernate will respond when multiple representations of the same persistent entity ("entity copy") are detected while merging.

public static final String
public static final String
USE_IDENTIFIER_ROLLBACK

When enabled, specifies that the generated identifier of an entity is unset when the entity is deleted.

Inherited from org.hibernate.cfg.BatchSettings:
BATCH_STRATEGYBATCH_VERSIONED_DATABUILDERORDER_INSERTSORDER_UPDATESSTATEMENT_BATCH_SIZE
Inherited from org.hibernate.cfg.BytecodeSettings:
BYTECODE_PROVIDERENHANCER_ENABLE_ASSOCIATION_MANAGEMENTENHANCER_ENABLE_DIRTY_TRACKINGENHANCER_ENABLE_LAZY_INITIALIZATION
Inherited from org.hibernate.cfg.CacheSettings:
AUTO_EVICT_COLLECTION_CACHECACHE_KEYS_FACTORYCACHE_REGION_FACTORYCACHE_REGION_PREFIXCLASS_CACHE_PREFIXCOLLECTION_CACHE_PREFIXDEFAULT_CACHE_CONCURRENCY_STRATEGYJAKARTA_SHARED_CACHE_MODEJAKARTA_SHARED_CACHE_RETRIEVE_MODEJAKARTA_SHARED_CACHE_STORE_MODEJPA_SHARED_CACHE_MODEJPA_SHARED_CACHE_RETRIEVE_MODEJPA_SHARED_CACHE_STORE_MODEQUERY_CACHE_FACTORYUSE_DIRECT_REFERENCE_CACHE_ENTRIESUSE_MINIMAL_PUTSUSE_QUERY_CACHEUSE_SECOND_LEVEL_CACHEUSE_STRUCTURED_CACHE
Inherited from org.hibernate.cfg.EnvironmentSettings:
CLASSLOADERSJNDI_CLASSJNDI_PREFIXJNDI_URLTC_CLASSLOADER
Inherited from org.hibernate.cfg.FetchSettings:
BATCH_FETCH_STYLEDEFAULT_BATCH_FETCH_SIZEMAX_FETCH_DEPTHUSE_SUBSELECT_FETCH
Inherited from org.hibernate.cfg.JdbcSettings:
AUTOCOMMITCONNECTION_HANDLINGCONNECTION_PREFIXCONNECTION_PROVIDERCONNECTION_PROVIDER_DISABLES_AUTOCOMMITDATASOURCEDIALECTDIALECT_DB_MAJOR_VERSIONDIALECT_DB_MINOR_VERSIONDIALECT_DB_NAMEDIALECT_DB_VERSIONDIALECT_NATIVE_PARAM_MARKERSDIALECT_RESOLVERSDRIVERFORMAT_SQLHBM2DDL_CONNECTIONHIGHLIGHT_SQLISOLATIONJAKARTA_HBM2DDL_CONNECTIONJAKARTA_HBM2DDL_DB_MAJOR_VERSIONJAKARTA_HBM2DDL_DB_MINOR_VERSIONJAKARTA_HBM2DDL_DB_NAMEJAKARTA_HBM2DDL_DB_VERSIONJAKARTA_JDBC_DRIVERJAKARTA_JDBC_PASSWORDJAKARTA_JDBC_URLJAKARTA_JDBC_USERJAKARTA_JTA_DATASOURCEJAKARTA_NON_JTA_DATASOURCEJDBC_TIME_ZONEJPA_JDBC_DRIVERJPA_JDBC_PASSWORDJPA_JDBC_URLJPA_JDBC_USERJPA_JTA_DATASOURCEJPA_NON_JTA_DATASOURCELOG_JDBC_WARNINGSLOG_SLOW_QUERYNON_CONTEXTUAL_LOB_CREATIONPASSPOOL_SIZESHOW_SQLSTATEMENT_FETCH_SIZESTATEMENT_INSPECTORURLUSE_GET_GENERATED_KEYSUSE_SCROLLABLE_RESULTSETUSE_SQL_COMMENTSUSER
Inherited from org.hibernate.cfg.JpaComplianceSettings:
JPA_CACHING_COMPLIANCEJPA_CLOSED_COMPLIANCEJPA_COMPLIANCEJPA_ID_GENERATOR_GLOBAL_SCOPE_COMPLIANCEJPA_LIST_COMPLIANCEJPA_LOAD_BY_ID_COMPLIANCEJPA_ORDER_BY_MAPPING_COMPLIANCEJPA_PROXY_COMPLIANCEJPA_QUERY_COMPLIANCEJPA_TRANSACTION_COMPLIANCEJPAQL_STRICT_COMPLIANCE
Inherited from org.hibernate.cfg.ManagedBeanSettings:
ALLOW_EXTENSIONS_IN_CDIBEAN_CONTAINERCDI_BEAN_MANAGERDELAY_CDI_ACCESSJAKARTA_CDI_BEAN_MANAGER
Inherited from org.hibernate.cfg.MappingSettings:
ARTIFACT_PROCESSING_ORDERCOLUMN_ORDERING_STRATEGYCREATE_EMPTY_COMPOSITES_ENABLEDDEFAULT_CATALOGDEFAULT_LIST_SEMANTICSDEFAULT_SCHEMAFORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULTGLOBALLY_QUOTED_IDENTIFIERSGLOBALLY_QUOTED_IDENTIFIERS_SKIP_COLUMN_DEFINITIONSID_DB_STRUCTURE_NAMING_STRATEGYIGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASSIMPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASSIMPLICIT_NAMING_STRATEGYJPA_METAMODEL_POPULATIONJSON_FORMAT_MAPPERKEYWORD_AUTO_QUOTING_ENABLEDPHYSICAL_NAMING_STRATEGYPREFERRED_BOOLEAN_JDBC_TYPEPREFERRED_DURATION_JDBC_TYPEPREFERRED_INSTANT_JDBC_TYPEPREFERRED_POOLED_OPTIMIZERPREFERRED_UUID_JDBC_TYPESEQUENCE_INCREMENT_SIZE_MISMATCH_STRATEGYSTATIC_METAMODEL_POPULATIONTABLE_GENERATOR_STORE_LAST_USEDTIMEZONE_DEFAULT_STORAGETRANSFORM_HBM_XMLTRANSFORM_HBM_XML_FEATURE_HANDLINGUSE_ENTITY_WHERE_CLAUSE_FOR_COLLECTIONSUSE_NATIONALIZED_CHARACTER_DATAVALIDATE_XMLWRAPPER_ARRAY_HANDLINGXML_FORMAT_MAPPERXML_MAPPING_ENABLED
Inherited from org.hibernate.cfg.MultiTenancySettings:
MULTI_TENANT_CONNECTION_PROVIDERMULTI_TENANT_IDENTIFIER_RESOLVERTENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
Inherited from org.hibernate.cfg.PersistenceSettings:
JAKARTA_PERSISTENCE_PROVIDERJAKARTA_TRANSACTION_TYPEJPA_CALLBACKS_ENABLEDJPA_PERSISTENCE_PROVIDERJPA_TRANSACTION_TYPEPERSISTENCE_UNIT_NAMESCANNERSCANNER_ARCHIVE_INTERPRETERSCANNER_DISCOVERYSESSION_FACTORY_NAMESESSION_FACTORY_NAME_IS_JNDISESSION_FACTORY_OBSERVER
Inherited from org.hibernate.cfg.QuerySettings:
CALLABLE_NAMED_PARAMS_ENABLEDCRITERIA_COPY_TREECRITERIA_VALUE_HANDLING_MODEDEFAULT_NULL_ORDERINGFAIL_ON_PAGINATION_OVER_COLLECTION_FETCHIMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODEIN_CLAUSE_PARAMETER_PADDINGNATIVE_IGNORE_JDBC_PARAMETERSQUERY_MULTI_TABLE_INSERT_STRATEGYQUERY_MULTI_TABLE_MUTATION_STRATEGYQUERY_PLAN_CACHE_ENABLEDQUERY_PLAN_CACHE_MAX_SIZEQUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZEQUERY_STARTUP_CHECKINGSEMANTIC_QUERY_PRODUCERSEMANTIC_QUERY_TRANSLATOR
Inherited from org.hibernate.cfg.SchemaToolingSettings:
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_CREATE_TABLESBULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLESBULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLESBULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLESBULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLESENABLE_SYNONYMSEXTRA_PHYSICAL_TABLE_TYPESHBM2DDL_AUTOHBM2DDL_CHARSET_NAMEHBM2DDL_CREATE_NAMESPACESHBM2DDL_CREATE_SCHEMASHBM2DDL_CREATE_SCRIPT_SOURCEHBM2DDL_CREATE_SOURCEHBM2DDL_DATABASE_ACTIONHBM2DDL_DEFAULT_CONSTRAINT_MODEHBM2DDL_DELIMITERHBM2DDL_DROP_SCRIPT_SOURCEHBM2DDL_DROP_SOURCEHBM2DDL_FILTER_PROVIDERHBM2DDL_HALT_ON_ERRORHBM2DDL_IMPORT_FILESHBM2DDL_IMPORT_FILES_SQL_EXTRACTORHBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGYHBM2DDL_LOAD_SCRIPT_SOURCEHBM2DDL_SCRIPTS_ACTIONHBM2DDL_SCRIPTS_CREATE_APPENDHBM2DDL_SCRIPTS_CREATE_TARGETHBM2DDL_SCRIPTS_DROP_TARGETJAKARTA_HBM2DDL_CREATE_SCHEMASJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCEJAKARTA_HBM2DDL_CREATE_SOURCEJAKARTA_HBM2DDL_DATABASE_ACTIONJAKARTA_HBM2DDL_DROP_SCRIPT_SOURCEJAKARTA_HBM2DDL_DROP_SOURCEJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCEJAKARTA_HBM2DDL_SCRIPTS_ACTIONJAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGETJAKARTA_HBM2DDL_SCRIPTS_DROP_TARGETSCHEMA_MANAGEMENT_TOOLSTORAGE_ENGINEUNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY
Inherited from org.hibernate.cfg.SessionEventSettings:
AUTO_SESSION_EVENTS_LISTENERINTERCEPTORLOG_SESSION_METRICSSESSION_SCOPED_INTERCEPTOR
Inherited from org.hibernate.cfg.StatisticsSettings:
GENERATE_STATISTICSQUERY_STATISTICS_MAX_SIZESTATS_BUILDER
Inherited from org.hibernate.cfg.TransactionSettings:
ALLOW_JTA_TRANSACTION_ACCESSALLOW_UPDATE_OUTSIDE_TRANSACTIONAUTO_CLOSE_SESSIONENABLE_LAZY_LOAD_NO_TRANSFLUSH_BEFORE_COMPLETIONJTA_CACHE_TMJTA_CACHE_UTJTA_PLATFORMJTA_PLATFORM_RESOLVERJTA_TRACK_BY_THREADPREFER_USER_TRANSACTIONTRANSACTION_COORDINATOR_STRATEGY
Inherited from org.hibernate.cfg.ValidationSettings:
CHECK_NULLABILITYJAKARTA_PERSIST_VALIDATION_GROUPJAKARTA_REMOVE_VALIDATION_GROUPJAKARTA_UPDATE_VALIDATION_GROUPJAKARTA_VALIDATION_FACTORYJAKARTA_VALIDATION_MODEJPA_PERSIST_VALIDATION_GROUPJPA_REMOVE_VALIDATION_GROUPJPA_UPDATE_VALIDATION_GROUPJPA_VALIDATION_FACTORYJPA_VALIDATION_MODE

Field Detail

ALLOW_REFRESH_DETACHED_ENTITYback to summary
public static final String ALLOW_REFRESH_DETACHED_ENTITY

When enabled, allows calls to jakarta.persistence.EntityManager#refresh(Object) and org.hibernate.Session#refresh(Object) on a detached entity instance.

Values are true, which allows refreshing a detached instance and false, which does not. When refreshing is disallowed, an IllegalArgumentException is thrown.

The default behavior is to allow refreshing a detached instance unless Hibernate is bootstrapped via JPA.

Since
5.2
CFG_XML_FILEback to summary
public static final String CFG_XML_FILE
CURRENT_SESSION_CONTEXT_CLASSback to summary
public static final String CURRENT_SESSION_CONTEXT_CLASS

Specifies a org.hibernate.context.spi.CurrentSessionContext for scoping the current session, either:

  • jta, thread, or managed, or
  • the name of a class implementing org.hibernate.context.spi.CurrentSessionContext.
If this property is not set, but JTA support is enabled, then org.hibernate.context.internal.JTASessionContext is used by default.
See Also
org.hibernate.SessionFactory#getCurrentSession(), org.hibernate.context.spi.CurrentSessionContext
CUSTOM_ENTITY_DIRTINESS_STRATEGYback to summary
public static final String CUSTOM_ENTITY_DIRTINESS_STRATEGY

Setting to identify a org.hibernate.CustomEntityDirtinessStrategy to use. May specify either a class name or an instance.

See Also
org.hibernate.boot.SessionFactoryBuilder#applyCustomEntityDirtinessStrategy(CustomEntityDirtinessStrategy)
DELAY_ENTITY_LOADER_CREATIONSback to summary
public static final String DELAY_ENTITY_LOADER_CREATIONS

Controls how entity loaders are created.

When true, the default, the loaders are only created on first access; this ensures that all access patterns which are not useful to the application are never instantiated, possibly saving a substantial amount of memory for applications having many entities. The only exception is the loader for org.hibernate.LockMode#NONE, which will always be eagerly initialized; this is necessary to detect mapping errors.

false indicates that all loaders should be created up front; this will consume more memory but ensures all necessary memory is allocated right away.

Since
5.3
See Also
org.hibernate.boot.SessionFactoryBuilder#applyDelayedEntityLoaderCreations(boolean)
DISCARD_PC_ON_CLOSEback to summary
public static final String DISCARD_PC_ON_CLOSE

When enabled, specifies that the persistent context should be discarded when either org.hibernate.Session#close() or jakarta.persistence.EntityManager#close() is called.

EVENT_LISTENER_PREFIXback to summary
public static final String EVENT_LISTENER_PREFIX

Event listener configuration properties follow the pattern hibernate.event.listener.eventType packageName.ClassName1, packageName.ClassName2

FLUSH_MODEback to summary
public static final String FLUSH_MODE

Deprecated

for removal since 6.2.

There are much better ways to control the flush mode of a session, for example, org.hibernate.SessionBuilder#flushMode or org.hibernate.Session#setHibernateFlushMode.

Annotations
@Deprecated
since:6.2
forRemoval:true
@SuppressWarnings:DeprecatedIsStillUsed
See Also
org.hibernate.jpa.HibernateHints#HINT_FLUSH_MODE
HBM_XML_FILESback to summary
public static final String HBM_XML_FILES
IDENTIFIER_GENERATOR_STRATEGY_PROVIDERback to summary
public static final String IDENTIFIER_GENERATOR_STRATEGY_PROVIDER

Specifies a class which implements org.hibernate.jpa.spi.IdentifierGeneratorStrategyProvider, and has a constructor with no parameters.

Annotations
@Deprecated
since:6.0
@SuppressWarnings:DeprecatedIsStillUsed
JAKARTA_LOCK_SCOPEback to summary
public static final String JAKARTA_LOCK_SCOPE

Set a default value for the hint SpecHints#HINT_SPEC_LOCK_SCOPE, used when the hint is not explicitly specified.

See JPA 2 sections 8.2.1.9 and 3.4.4.3

See Also
SpecHints#HINT_SPEC_LOCK_SCOPE
JAKARTA_LOCK_TIMEOUTback to summary
public static final String JAKARTA_LOCK_TIMEOUT

Set a default value for the hint SpecHints#HINT_SPEC_LOCK_TIMEOUT, used when the hint is not explicitly specified.

See JPA 2 sections 8.2.1.9 and 3.4.4.3

See Also
SpecHints#HINT_SPEC_LOCK_TIMEOUT
JPA_LOCK_SCOPEback to summary
public static final String JPA_LOCK_SCOPE

Deprecated

Use JAKARTA_LOCK_SCOPE instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
JPA_LOCK_TIMEOUTback to summary
public static final String JPA_LOCK_TIMEOUT

Deprecated

Use JAKARTA_LOCK_TIMEOUT instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
LOADED_CLASSESback to summary
public static final String LOADED_CLASSES
MERGE_ENTITY_COPY_OBSERVERback to summary
public static final String MERGE_ENTITY_COPY_OBSERVER

Setting that specifies how Hibernate will respond when multiple representations of the same persistent entity ("entity copy") are detected while merging.

The possible values are:

  • disallow (the default): throws IllegalStateException if an entity copy is detected
  • allow: performs the merge operation on each entity copy that is detected
  • log: (provided for testing only) performs the merge operation on each entity copy that is detected and logs information about the entity copies. This setting requires DEBUG logging be enabled for org.hibernate.event.internal.EntityCopyAllowedLoggedObserver.

Alternatively, the application may customize the behavior by providing an implementation of org.hibernate.event.spi.EntityCopyObserver and setting the property hibernate.event.merge.entity_copy_observer to the class name.

When this property is set to allow or log, Hibernate will merge each entity copy detected while cascading the merge operation. In the process of merging each entity copy, Hibernate will cascade the merge operation from each entity copy to its associations with jakarta.persistence.CascadeType#MERGE or jakarta.persistence.CascadeType#ALL. The entity state resulting from merging an entity copy will be overwritten when another entity copy is merged.

Annotations
@SuppressWarnings:JavaDoc
Since
4.3
ORM_XML_FILESback to summary
public static final String ORM_XML_FILES
USE_IDENTIFIER_ROLLBACKback to summary
public static final String USE_IDENTIFIER_ROLLBACK

When enabled, specifies that the generated identifier of an entity is unset when the entity is deleted.

See Also
org.hibernate.boot.SessionFactoryBuilder#applyIdentifierRollbackSupport(boolean)