Interface SchemaToolingSettings
-
public interface SchemaToolingSettings
-
-
Field Summary
Fields Modifier and Type Field Description static String
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_CREATE_TABLES
Allows creation of global temporary tables at application startup to be disabled.static String
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLES
Allows dropping of global temporary tables at application shutdown to be disabled.static String
BULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLES
Allows dropping of local temporary tables at transaction commit to be enabled.static String
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLES
Allows creation of persistent temporary tables at application startup to be disabled.static String
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLES
Allows dropping of persistent temporary tables at application shutdown to be disabled.static String
ENABLE_SYNONYMS
If enabled, allows schema update and validation to support synonyms.static String
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.static String
HBM2DDL_AUTO
Setting to performSchemaManagementTool
actions automatically as part of theSessionFactory
lifecycle.static String
HBM2DDL_CHARSET_NAME
The name of the charset used by the schema generation resource.static String
HBM2DDL_CREATE_NAMESPACES
Deprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCHEMAS
is now preferred.static String
HBM2DDL_CREATE_SCHEMAS
Deprecated.UseJAKARTA_HBM2DDL_CREATE_SCHEMAS
insteadstatic String
HBM2DDL_CREATE_SCRIPT_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
static String
HBM2DDL_CREATE_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SOURCE
insteadstatic String
HBM2DDL_DATABASE_ACTION
Deprecated.UseJAKARTA_HBM2DDL_DATABASE_ACTION
insteadstatic String
HBM2DDL_DEFAULT_CONSTRAINT_MODE
Used with theConstraintMode.PROVIDER_DEFAULT
strategy for foreign key mapping.static String
HBM2DDL_DELIMITER
Identifies the delimiter to use to separate schema management statements in script outputs.static String
HBM2DDL_DROP_SCRIPT_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
static String
HBM2DDL_DROP_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SOURCE
.static String
HBM2DDL_FILTER_PROVIDER
Used to specify theSchemaFilterProvider
to be used by create, drop, migrate and validate operations on the database schema.static String
HBM2DDL_HALT_ON_ERROR
When enabled, specifies that the schema migration tool should halt on any error, terminating the bootstrap process.static String
HBM2DDL_IMPORT_FILES
Deprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
is now preferred.static String
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
.static String
HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGY
Setting to choose the strategy used to access the JDBC Metadata.static String
HBM2DDL_LOAD_SCRIPT_SOURCE
Deprecated.UseJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
insteadstatic String
HBM2DDL_SCRIPTS_ACTION
Deprecated.UseJAKARTA_HBM2DDL_SCRIPTS_ACTION
insteadstatic String
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.static String
HBM2DDL_SCRIPTS_CREATE_TARGET
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET
static String
HBM2DDL_SCRIPTS_DROP_TARGET
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET
static String
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.static String
JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
static String
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.static String
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
.static String
JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
static String
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.static String
JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
JPA-standard variant ofHBM2DDL_IMPORT_FILES
for specifying a database initialization script to be run as part of schema-exportstatic String
JAKARTA_HBM2DDL_SCRIPTS_ACTION
Specifies what type of schema tooling action should be written to script files.static String
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.static String
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.static String
SCHEMA_MANAGEMENT_TOOL
Specifies theSchemaManagementTool
to use for performing schema management.static String
STORAGE_ENGINE
Specifies the default storage engine for a relational databases that supports multiple storage engines.static String
UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY
Unique columns and unique keys both use unique constraints in most dialects.
-
-
-
Field Detail
-
JAKARTA_HBM2DDL_DATABASE_ACTION
static final String 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
static final String 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
static final String 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:
SourceType
, Constant Field Values
- if source scripts are specified via "jakarta.persistence.schema-generation.create-script-source",
then
-
JAKARTA_HBM2DDL_DROP_SOURCE
static final String 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:
SourceType
, Constant Field Values
-
JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
static final String 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
static final String JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
Specifies the DROP script file as either aReader
configured for reading the DDL script file or a string designating a fileURL
for the DDL script.- See Also:
JAKARTA_HBM2DDL_DROP_SOURCE
, Constant Field Values
-
JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET
static final String 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
static final String 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
static final String 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:
- Constant Field Values
-
JAKARTA_HBM2DDL_CREATE_SCHEMAS
static final String 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:
- Constant Field Values
-
SCHEMA_MANAGEMENT_TOOL
static final String SCHEMA_MANAGEMENT_TOOL
Specifies theSchemaManagementTool
to use for performing schema management.By default,
HibernateSchemaManagementTool
is used.- Since:
- 5.0
- See Also:
- Constant Field Values
-
HBM2DDL_AUTO
static final String 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:
Action
, Constant Field Values- Default Value:
"none"
-
HBM2DDL_SCRIPTS_CREATE_APPEND
static final String 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:
- Constant Field Values
- Default Value:
true
-
HBM2DDL_IMPORT_FILES_SQL_EXTRACTOR
static final String 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:
SingleLineSqlScriptExtractor
,MultiLineSqlScriptExtractor
, Constant Field Values- Default Value:
org.hibernate.tool.schema.internal.script.SingleLineSqlScriptExtractor
.
- an instance of
-
HBM2DDL_FILTER_PROVIDER
static final String 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:
- Constant Field Values
-
HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGY
static final String 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:
JdbcMetadaAccessStrategy
, Constant Field Values- Default Value:
- Grouped, unless "hibernate.synonyms" is enabled
-
HBM2DDL_DELIMITER
static final String HBM2DDL_DELIMITER
Identifies the delimiter to use to separate schema management statements in script outputs.- See Also:
- Constant Field Values
- Default Value:
;
-
HBM2DDL_CHARSET_NAME
static final String 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:
- Constant Field Values
-
HBM2DDL_HALT_ON_ERROR
static final String 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:
- Constant Field Values
- Default Value:
false
-
HBM2DDL_DEFAULT_CONSTRAINT_MODE
static final String 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:
- Constant Field Values
- Default Value:
ConstraintMode.CONSTRAINT
.
-
STORAGE_ENGINE
static final String 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:
- Constant Field Values
-
ENABLE_SYNONYMS
static final String 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:
- Constant Field Values
- Default Value:
false
-
EXTRA_PHYSICAL_TABLE_TYPES
static final String 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:
- Constant Field Values
-
UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY
static final String 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:
- Constant Field Values
- Default Value:
- DROP_RECREATE_QUIETLY
-
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLES
static final String BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLES
Allows creation of persistent temporary tables at application startup to be disabled. By default, table creation is enabled.- See Also:
- Constant Field Values
-
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLES
static final String BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLES
Allows dropping of persistent temporary tables at application shutdown to be disabled. By default, table dropping is enabled.- See Also:
- Constant Field Values
-
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_CREATE_TABLES
static final String BULK_ID_STRATEGY_GLOBAL_TEMPORARY_CREATE_TABLES
Allows creation of global temporary tables at application startup to be disabled. By default, table creation is enabled.- See Also:
- Constant Field Values
-
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLES
static final String BULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLES
Allows dropping of global temporary tables at application shutdown to be disabled. By default, table dropping is enabled.- See Also:
- Constant Field Values
-
BULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLES
static final String BULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLES
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:
- Constant Field Values
-
HBM2DDL_IMPORT_FILES
@Deprecated static final String 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:
- Constant Field Values
-
HBM2DDL_CREATE_NAMESPACES
@Deprecated static final String 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:
- Constant Field Values
-
HBM2DDL_DATABASE_ACTION
@Deprecated static final String HBM2DDL_DATABASE_ACTION
Deprecated.UseJAKARTA_HBM2DDL_DATABASE_ACTION
instead- See Also:
- Constant Field Values
-
HBM2DDL_SCRIPTS_ACTION
@Deprecated static final String HBM2DDL_SCRIPTS_ACTION
Deprecated.UseJAKARTA_HBM2DDL_SCRIPTS_ACTION
instead- See Also:
- Constant Field Values
-
HBM2DDL_CREATE_SOURCE
@Deprecated static final String HBM2DDL_CREATE_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SOURCE
instead- See Also:
SourceType
, Constant Field Values
-
HBM2DDL_DROP_SOURCE
@Deprecated static final String HBM2DDL_DROP_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SOURCE
.- See Also:
SourceType
, Constant Field Values
-
HBM2DDL_CREATE_SCRIPT_SOURCE
@Deprecated static final String HBM2DDL_CREATE_SCRIPT_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE
- See Also:
- Constant Field Values
-
HBM2DDL_DROP_SCRIPT_SOURCE
@Deprecated static final String HBM2DDL_DROP_SCRIPT_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
- See Also:
- Constant Field Values
-
HBM2DDL_SCRIPTS_CREATE_TARGET
@Deprecated static final String HBM2DDL_SCRIPTS_CREATE_TARGET
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET
- See Also:
- Constant Field Values
-
HBM2DDL_SCRIPTS_DROP_TARGET
@Deprecated static final String HBM2DDL_SCRIPTS_DROP_TARGET
Deprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET
- See Also:
- Constant Field Values
-
HBM2DDL_LOAD_SCRIPT_SOURCE
@Deprecated static final String HBM2DDL_LOAD_SCRIPT_SOURCE
Deprecated.UseJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
instead- See Also:
- Constant Field Values
-
HBM2DDL_CREATE_SCHEMAS
@Deprecated static final String HBM2DDL_CREATE_SCHEMAS
Deprecated.UseJAKARTA_HBM2DDL_CREATE_SCHEMAS
instead- See Also:
- Constant Field Values
-
-