Interface SchemaToolingSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringIf enabled, allows schema update and validation to support synonyms.static final StringSpecifies 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 StringSetting to performSchemaManagementToolactions automatically as part of theSessionFactorylifecycle.static final StringThe name of the charset used by the schema generation resource.static final StringDeprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCHEMASis now preferred.static final StringDeprecated.UseJAKARTA_HBM2DDL_CREATE_SCHEMASinsteadstatic final StringDeprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCEstatic final StringDeprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SOURCEinsteadstatic final StringDeprecated.UseJAKARTA_HBM2DDL_DATABASE_ACTIONinsteadstatic final StringUsed with theConstraintMode.PROVIDER_DEFAULTstrategy for foreign key mapping.static final StringIdentifies the delimiter to use to separate schema management statements in script outputs.static final StringDeprecated.Migrate toJAKARTA_HBM2DDL_DROP_SCRIPT_SOURCEstatic final StringDeprecated.Migrate toJAKARTA_HBM2DDL_DROP_SOURCE.static final StringUsed to specify theSchemaFilterProviderto be used by create, drop, migrate and validate operations on the database schema.static final StringWhen enabled, specifies that the schema migration tool should halt on any error, terminating the bootstrap process.static final StringDeprecated.The JPA-standard settingJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCEis now preferred.static final StringTheSqlScriptCommandExtractorimplementation to use for parsing source/import files specified byJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE,JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCEorHBM2DDL_IMPORT_FILES.static final StringSetting to choose the strategy used to access the JDBC Metadata.static final StringDeprecated.UseJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCEinsteadstatic final StringDeprecated.UseJAKARTA_HBM2DDL_SCRIPTS_ACTIONinsteadstatic final StringFor 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 StringDeprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGETstatic final StringDeprecated.Migrate toJAKARTA_HBM2DDL_SCRIPTS_DROP_TARGETstatic final StringSpecifies that the default/import.sqlscript file should not be executed whenHBM2DDL_IMPORT_FILESis not specified and "hibernate.hbm2ddl.auto" is set tocreateorcreate-drop.static final StringThe JPA variant ofHBM2DDL_CREATE_NAMESPACESused 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 Stringstatic final StringSpecifies 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 StringSpecifies what type of schema tooling action should be performed against the database specified using either "jakarta.persistence.schema-generation-connection" or the configuredConnectionProviderfor theSessionFactory.static final Stringstatic final StringSpecifies 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 StringJPA-standard variant ofHBM2DDL_IMPORT_FILESfor specifying a database initialization script to be run after exporting or truncating the database schema.static final StringSpecifies what type of schema tooling action should be written to script files.static final StringFor cases where "jakarta.persistence.schema-generation.scripts.action" indicates that schema creation commands should be written to a script file, this setting specifies either aWriterconfigured for output of the DDL script or a string specifying the file URL for the DDL script.static final StringFor cases where "jakarta.persistence.schema-generation.scripts.action" indicates that schema drop commands should be written to a script file, this setting specifies either aWriterconfigured for output of the DDL script or a string specifying the file URL for the DDL script.static final StringSpecifies theSchemaManagementToolto use for performing schema management.static final StringSpecifies the default storage engine for a relational database that supports multiple storage engines.static final StringUnique 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 configuredConnectionProviderfor theSessionFactory.Valid options are enumerated by
Action.This setting takes precedence over "hibernate.hbm2ddl.auto".
If no value is specified, the default is
"none".- See Also:
-
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".- See Also:
-
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. SeeSourceTypefor 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. SeeSourceTypefor 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 aReaderconfigured for reading the DDL script file or a string designating a fileURLfor the DDL script.The script should contain mostly DDL
CREATEstatements. For importing data using DML, useJAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE.- See Also:
-
JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE
Specifies the DROP script file as either aReaderconfigured for reading the DDL script file or a string designating a fileURLfor the DDL script.The script should contain mostly DDL
DROPstatements.- See Also:
-
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 aWriterconfigured for output of the DDL script or a string specifying the file URL for the DDL script.- See Also:
-
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 aWriterconfigured for output of the DDL script or a string specifying the file URL for the DDL script.- See Also:
-
JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE
JPA-standard variant ofHBM2DDL_IMPORT_FILESfor specifying a database initialization script to be run after exporting or truncating the database schema.Specifies a
Readerconfigured for reading of the SQL load script or a string designating theURLfor the SQL load script.The script should contain mostly DML
INSERTstatements. For DDL schema creation, useJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCEHibernate historically also accepted
HBM2DDL_IMPORT_FILESfor a similar purpose. This setting is now preferred.- See Also:
-
JAKARTA_HBM2DDL_CREATE_SCHEMAS
The JPA variant ofHBM2DDL_CREATE_NAMESPACESused 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 theSchemaManagementToolto use for performing schema management.By default,
HibernateSchemaManagementToolis used.- Since:
- 5.0
- See Also:
-
HBM2DDL_AUTO
Setting to performSchemaManagementToolactions automatically as part of theSessionFactorylifecycle. Valid options are enumerated byAction.Interpreted in combination with
JAKARTA_HBM2DDL_DATABASE_ACTIONandJAKARTA_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:
truefor appending schema commands to the end of the file,falsefor writing schema commands at the beginning.- See Also:
- Default Value:
true
-
HBM2DDL_IMPORT_FILES_SQL_EXTRACTOR
TheSqlScriptCommandExtractorimplementation to use for parsing source/import files specified byJAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE,JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCEorHBM2DDL_IMPORT_FILES. Either:- an instance of
SqlScriptCommandExtractor, - a
Classobject 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
single-lineorSingleLineSqlScriptExtractor, or - if a script contains statements spread over multiple lines, use
multi-lineorMultiLineSqlScriptExtractor.
- See Also:
- Default Value:
org.hibernate.tool.schema.internal.script.SingleLineSqlScriptExtractor.
- an instance of
-
HBM2DDL_FILTER_PROVIDER
Used to specify theSchemaFilterProviderto be used by create, drop, migrate and validate operations on the database schema. ASchemaFilterProviderprovides 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.GROUPEDis 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_DEFAULTstrategy for foreign key mapping.Valid values are
ConstraintMode.CONSTRAINTandConstraintMode.NO_CONSTRAINT.- Since:
- 5.4
- See Also:
- Default Value:
ConstraintMode.CONSTRAINT.
-
STORAGE_ENGINE
Specifies the default storage engine for a relational database that supports multiple storage engines. This property must be set either as anEnvironmentvariable or JVM System Property, since theDialectis instantiated before Hibernate property resolution.For MySQL, the legal values are
innodb(the default) andmyisam.- 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_LOAD_SCRIPT_SOURCEis 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
createorcreate-drop.The default value is
/import.sql.- See Also:
-
HBM2DDL_SKIP_DEFAULT_IMPORT_FILE
Specifies that the default/import.sqlscript file should not be executed whenHBM2DDL_IMPORT_FILESis not specified and "hibernate.hbm2ddl.auto" is set tocreateorcreate-drop.- Since:
- 6.6
- See Also:
- Default Value:
false.
-
HBM2DDL_CREATE_NAMESPACES
Deprecated.The JPA-standard settingJAKARTA_HBM2DDL_CREATE_SCHEMASis 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_ACTIONinstead- See Also:
-
HBM2DDL_SCRIPTS_ACTION
Deprecated.UseJAKARTA_HBM2DDL_SCRIPTS_ACTIONinstead- See Also:
-
HBM2DDL_CREATE_SOURCE
Deprecated.Migrate toJAKARTA_HBM2DDL_CREATE_SOURCEinstead- 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_SOURCEinstead- See Also:
-
HBM2DDL_CREATE_SCHEMAS
Deprecated.UseJAKARTA_HBM2DDL_CREATE_SCHEMASinstead- See Also:
-
GlobalTemporaryTableStrategy.CREATE_ID_TABLES.