Interface SchemaToolingSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
If enabled, allows schema update and validation to support synonyms.static final String
Specifies a comma-separated list of extra table types, in addition to the default types"TABLE"
and"VIEW"
, to recognize as physical tables when performing schema update, creation and validation.static final String
Setting to performSchemaManagementTool
actions automatically as part of theSessionFactory
lifecycle.static final String
The name of the charset used by the schema generation resource.static final String
Deprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCHEMAS
is now preferred.static final String
Deprecated.UseJAKARTA_HBM2DDL_CREATE_SCHEMAS
insteadstatic final String
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
static final String
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SOURCE
insteadstatic final String
Deprecated.UseJAKARTA_HBM2DDL_DATABASE_ACTION
insteadstatic final String
Used with theConstraintMode.PROVIDER_DEFAULT
strategy for foreign key mapping.static final String
Identifies the delimiter to use to separate schema management statements in script outputs.static final String
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
static final String
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SOURCE
.static final String
Used to specify theSchemaFilterProvider
to be used by create, drop, migrate and validate operations on the database schema.static final String
When enabled, specifies that the schema migration tool should halt on any error, terminating the bootstrap process.static final String
Deprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
is now preferred.static final String
TheSqlScriptCommandExtractor
implementation to use for parsing source/import files specified byJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
,JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
orHBM2DDL_IMPORT_FILES
.static final String
Setting to choose the strategy used to access the JDBC Metadata.static final String
Deprecated.UseJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
insteadstatic final String
Deprecated.UseJAKARTA_HBM2DDL_SCRIPTS_ACTION
insteadstatic final String
For cases where the "jakarta.persistence.schema-generation.scripts.action" value indicates that schema commands should be written to DDL script file, specifies if schema commands should be appended to the end of the file rather than written at the beginning of the file.static final String
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET
static final String
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET
static final String
The JPA variant ofHBM2DDL_CREATE_NAMESPACES
used to specify whether database schemas used in the mapping model should be created on export in addition to creating the tables, sequences, etc.static final String
static final String
Specifies whether schema generation commands for schema creation are to be determined based on object/relational mapping metadata, DDL scripts, or a combination of the two.static final String
Specifies what type of schema tooling action should be performed against the database specified using either "jakarta.persistence.schema-generation-connection" or the configuredConnectionProvider
for theSessionFactory
.static final String
static final String
Specifies whether schema generation commands for schema dropping are to be determined based on object/relational mapping metadata, DDL scripts, or a combination of the two.static final String
JPA-standard variant ofHBM2DDL_IMPORT_FILES
for specifying a database initialization script to be run as part of schema-exportstatic final String
Specifies what type of schema tooling action should be written to script files.static final String
For cases where "jakarta.persistence.schema-generation.scripts.action" indicates that schema creation commands should be written to a script file, this setting specifies either aWriter
configured for output of the DDL script or a string specifying the file URL for the DDL script.static final String
For cases where "jakarta.persistence.schema-generation.scripts.action" indicates that schema drop commands should be written to a script file, this setting specifies either aWriter
configured for output of the DDL script or a string specifying the file URL for the DDL script.static final String
Specifies theSchemaManagementTool
to use for performing schema management.static final String
Specifies the default storage engine for a relational databases that supports multiple storage engines.static final String
Unique columns and unique keys both use unique constraints in most dialects.
-
Field Details
-
JAKARTA_HBM2DDL_DATABASE_ACTION
Specifies what type of schema tooling action should be performed against the database specified using either "jakarta.persistence.schema-generation-connection" or the configuredConnectionProvider
for theSessionFactory
.Valid options are enumerated by
Action
.This setting takes precedence over "hibernate.hbm2ddl.auto".
If no value is specified, the default is
"none"
. -
JAKARTA_HBM2DDL_SCRIPTS_ACTION
Specifies what type of schema tooling action should be written to script files.Valid options are enumerated by
Action
.The script file is identified using "jakarta.persistence.schema-generation.scripts.create-target".
If no value is specified, the default is
"none"
. -
JAKARTA_HBM2DDL_CREATE_SOURCE
Specifies whether schema generation commands for schema creation are to be determined based on object/relational mapping metadata, DDL scripts, or a combination of the two. SeeSourceType
for the list of legal values.If no value is specified, a default is inferred as follows:
- if source scripts are specified via "jakarta.persistence.schema-generation.create-script-source",
then
"script"
is assumed, or - otherwise,
"metadata"
is assumed.
- See Also:
- if source scripts are specified via "jakarta.persistence.schema-generation.create-script-source",
then
-
JAKARTA_HBM2DDL_DROP_SOURCE
Specifies whether schema generation commands for schema dropping are to be determined based on object/relational mapping metadata, DDL scripts, or a combination of the two. SeeSourceType
for the list of legal values.If no value is specified, a default is inferred as follows:
- if source scripts are specified via "jakarta.persistence.schema-generation.drop-script-source", then "script" is assumed, or
- otherwise, "metadata" is assumed.
- See Also:
-
JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
Specifies the CREATE script file as either aReader
configured for reading the DDL script file or a string designating a fileURL
for the DDL script.Hibernate historically also accepted
HBM2DDL_IMPORT_FILES
for a similar purpose. This setting is now preferred. -
JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
-
JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET
For cases where "jakarta.persistence.schema-generation.scripts.action" indicates that schema creation commands should be written to a script file, this setting specifies either aWriter
configured for output of the DDL script or a string specifying the file URL for the DDL script. -
JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET
For cases where "jakarta.persistence.schema-generation.scripts.action" indicates that schema drop commands should be written to a script file, this setting specifies either aWriter
configured for output of the DDL script or a string specifying the file URL for the DDL script. -
JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
JPA-standard variant ofHBM2DDL_IMPORT_FILES
for specifying a database initialization script to be run as part of schema-exportSpecifies a
Reader
configured for reading of the SQL load script or a string designating theURL
for the SQL load script.- See Also:
-
JAKARTA_HBM2DDL_CREATE_SCHEMAS
The JPA variant ofHBM2DDL_CREATE_NAMESPACES
used to specify whether database schemas used in the mapping model should be created on export in addition to creating the tables, sequences, etc.The default is
false
, meaning to not create schemas- See Also:
-
SCHEMA_MANAGEMENT_TOOL
Specifies theSchemaManagementTool
to use for performing schema management.By default,
HibernateSchemaManagementTool
is used.- Since:
- 5.0
- See Also:
-
HBM2DDL_AUTO
Setting to performSchemaManagementTool
actions automatically as part of theSessionFactory
lifecycle. Valid options are enumerated byAction
.Interpreted in combination with
JAKARTA_HBM2DDL_DATABASE_ACTION
andJAKARTA_HBM2DDL_SCRIPTS_ACTION
. If no value is specified, the default is "none".- See Also:
- Default Value:
"none"
-
HBM2DDL_SCRIPTS_CREATE_APPEND
For cases where the "jakarta.persistence.schema-generation.scripts.action" value indicates that schema commands should be written to DDL script file, specifies if schema commands should be appended to the end of the file rather than written at the beginning of the file.Values are:
true
for appending schema commands to the end of the file,false
for writing schema commands at the beginning.- See Also:
- Default Value:
true
-
HBM2DDL_IMPORT_FILES_SQL_EXTRACTOR
TheSqlScriptCommandExtractor
implementation to use for parsing source/import files specified byJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
,JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
orHBM2DDL_IMPORT_FILES
. Either:- an instance of
SqlScriptCommandExtractor
, - a
Class
object representing a class that implementsSqlScriptCommandExtractor
, or - the name of a class that implements
SqlScriptCommandExtractor
.
The correct extractor to use depends on the format of the SQL script:
- if the script has one complete SQL statement per line, use
SingleLineSqlScriptExtractor
, or - if a script contains statements spread over multiple lines, use
MultiLineSqlScriptExtractor
.
- See Also:
- Default Value:
org.hibernate.tool.schema.internal.script.SingleLineSqlScriptExtractor
.
- an instance of
-
HBM2DDL_FILTER_PROVIDER
Used to specify theSchemaFilterProvider
to be used by create, drop, migrate and validate operations on the database schema. ASchemaFilterProvider
provides filters that can be used to limit the scope of these operations to specific namespaces, tables and sequences. All objects are included by default.- Since:
- 5.1
- See Also:
-
HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGY
Setting to choose the strategy used to access the JDBC Metadata.Valid options are defined by
JdbcMetadaAccessStrategy
.JdbcMetadaAccessStrategy.GROUPED
is the default.- See Also:
- Default Value:
- Grouped, unless "hibernate.synonyms" is enabled
-
HBM2DDL_DELIMITER
Identifies the delimiter to use to separate schema management statements in script outputs.- See Also:
- Default Value:
;
-
HBM2DDL_CHARSET_NAME
The name of the charset used by the schema generation resource.By default, the JVM default charset is used.
- Since:
- 5.2.3
- See Also:
-
HBM2DDL_HALT_ON_ERROR
When enabled, specifies that the schema migration tool should halt on any error, terminating the bootstrap process.- Since:
- 5.2.4
- See Also:
- Default Value:
false
-
HBM2DDL_DEFAULT_CONSTRAINT_MODE
Used with theConstraintMode.PROVIDER_DEFAULT
strategy for foreign key mapping.Valid values are
ConstraintMode.CONSTRAINT
andConstraintMode.NO_CONSTRAINT
.- Since:
- 5.4
- See Also:
- Default Value:
ConstraintMode.CONSTRAINT
.
-
STORAGE_ENGINE
Specifies the default storage engine for a relational databases that supports multiple storage engines. This property must be set either as anEnvironment
variable or JVM System Property, since theDialect
is instantiated before Hibernate property resolution.- Since:
- 5.2.9
- See Also:
-
ENABLE_SYNONYMS
If enabled, allows schema update and validation to support synonyms. Due to the possibility that this would return duplicate tables (especially in Oracle), this is disabled by default.- See Also:
- Default Value:
false
-
EXTRA_PHYSICAL_TABLE_TYPES
Specifies a comma-separated list of extra table types, in addition to the default types"TABLE"
and"VIEW"
, to recognize as physical tables when performing schema update, creation and validation.- Since:
- 5.0
- See Also:
-
UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY
Unique columns and unique keys both use unique constraints in most dialects. The schema exporter must create these constraints, but database support for finding existing constraints is extremely inconsistent. Worse, unique constraints without explicit names are assigned names with randomly generated characters.Therefore, select from these strategies:
- DROP_RECREATE_QUIETLY: Attempt to drop, then (re-)create each unique constraint, ignoring any exceptions thrown. This is the default.
- RECREATE_QUIETLY: Attempt to (re-)create unique constraints, ignoring exceptions thrown if the constraint already existed.
- SKIP: Do not attempt to create unique constraints on a schema update.
- See Also:
- Default Value:
- DROP_RECREATE_QUIETLY
-
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLES
@Deprecated(forRemoval=true) static final String BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLESDeprecated, for removal: This API element is subject to removal in a future version.Allows creation of persistent temporary tables at application startup to be disabled. By default, table creation is enabled.- See Also:
-
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLES
Deprecated, for removal: This API element is subject to removal in a future version.Allows dropping of persistent temporary tables at application shutdown to be disabled. By default, table dropping is enabled.- See Also:
-
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_CREATE_TABLES
Deprecated, for removal: This API element is subject to removal in a future version.Allows creation of global temporary tables at application startup to be disabled. By default, table creation is enabled.- See Also:
-
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLES
Deprecated, for removal: This API element is subject to removal in a future version.Allows dropping of global temporary tables at application shutdown to be disabled. By default, table dropping is enabled.- See Also:
-
BULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLES
Deprecated, for removal: This API element is subject to removal in a future version.Allows dropping of local temporary tables at transaction commit to be enabled. By default, table dropping is disabled, and the database will drop the temporary tables automatically.- See Also:
-
HBM2DDL_IMPORT_FILES
Deprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
is now preferred.Specifies a comma-separated list of file names of scripts containing SQL DML statements that should be executed after schema export completes. The order of the scripts is significant, with the first script in the list being executed first.The scripts are only executed if the schema is created by Hibernate, that is, if "hibernate.hbm2ddl.auto" is set to
create
orcreate-drop
.The default value is
/import.sql
.- See Also:
-
HBM2DDL_CREATE_NAMESPACES
Deprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCHEMAS
is now preferred.Specifies whether to automatically create also the database schema/catalog. The default is false.- Since:
- 5.0
- See Also:
-
HBM2DDL_DATABASE_ACTION
Deprecated.UseJAKARTA_HBM2DDL_DATABASE_ACTION
instead- See Also:
-
HBM2DDL_SCRIPTS_ACTION
Deprecated.UseJAKARTA_HBM2DDL_SCRIPTS_ACTION
instead- See Also:
-
HBM2DDL_CREATE_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SOURCE
instead- See Also:
-
HBM2DDL_DROP_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SOURCE
.- See Also:
-
HBM2DDL_CREATE_SCRIPT_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
- See Also:
-
HBM2DDL_DROP_SCRIPT_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
- See Also:
-
HBM2DDL_SCRIPTS_CREATE_TARGET
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET
- See Also:
-
HBM2DDL_SCRIPTS_DROP_TARGET
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET
- See Also:
-
HBM2DDL_LOAD_SCRIPT_SOURCE
Deprecated.UseJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
instead- See Also:
-
HBM2DDL_CREATE_SCHEMAS
Deprecated.UseJAKARTA_HBM2DDL_CREATE_SCHEMAS
instead- See Also:
-
GlobalTemporaryTableStrategy.CREATE_ID_TABLES
.