Top Fields
org.hibernate.cfg

public Interface SchemaToolingSettings

Known Direct Subinterfaces
org.hibernate.cfg.AvailableSettings
Imports
org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableStrategy, .LocalTemporaryTableStrategy, .PersistentTableStrategy, org.hibernate.tool.schema.UniqueConstraintSchemaUpdateStrategy

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final String
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_CREATE_TABLES

Allows creation of global temporary tables at application startup to be disabled.

public static final String
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLES

Allows dropping of global temporary tables at application shutdown to be disabled.

public static final String
BULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLES

Allows dropping of local temporary tables at transaction commit to be enabled.

public static final String
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLES

Allows creation of persistent temporary tables at application startup to be disabled.

public static final String
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLES

Allows dropping of persistent temporary tables at application shutdown to be disabled.

public static final String
ENABLE_SYNONYMS

If enabled, allows schema update and validation to support synonyms.

public 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.

public static final String
HBM2DDL_AUTO

Setting to perform org.hibernate.tool.schema.spi.SchemaManagementTool actions automatically as part of the org.hibernate.SessionFactory lifecycle.

public static final String
HBM2DDL_CHARSET_NAME

The name of the charset used by the schema generation resource.

public static final String
HBM2DDL_CREATE_NAMESPACES

Specifies whether to automatically create also the database schema/catalog.

public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
HBM2DDL_DELIMITER

Identifies the delimiter to use to separate schema management statements in script outputs.

public static final String
public static final String
public static final String
HBM2DDL_FILTER_PROVIDER

Used to specify the org.hibernate.tool.schema.spi.SchemaFilterProvider to be used by create, drop, migrate and validate operations on the database schema.

public static final String
HBM2DDL_HALT_ON_ERROR

When enabled, specifies that the schema migration tool should halt on any error, terminating the bootstrap process.

public static final String
HBM2DDL_IMPORT_FILES

Specifies a comma-separated list of file names of scripts containing SQL DML statements that should be executed after schema export completes.

public static final String
public static final String
HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGY

Setting to choose the strategy used to access the JDBC Metadata.

public static final String
public static final String
public 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.

public static final String
public static final String
public static final String
JAKARTA_HBM2DDL_CREATE_SCHEMAS

The JPA variant of HBM2DDL_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

public static final String
JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE

Specifies the CREATE script file as either a java.io.Reader configured for reading the DDL script file or a string designating a file java.net.URL for the DDL script.

public 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.

public 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 configured org.hibernate.engine.jdbc.connections.spi.ConnectionProvider for the org.hibernate.SessionFactory.

public static final String
JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE

Specifies the DROP script file as either a java.io.Reader configured for reading the DDL script file or a string designating a file java.net.URL for the DDL script.

public 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.

public static final String
JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE

JPA-standard variant of HBM2DDL_IMPORT_FILES for specifying a database initialization script to be run as part of schema-export

Specifies a java.io.Reader configured for reading of the SQL load script or a string designating the java.net.URL for the SQL load script.

public static final String
JAKARTA_HBM2DDL_SCRIPTS_ACTION

Specifies what type of schema tooling action should be written to script files.

public 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 a java.io.Writer configured for output of the DDL script or a string specifying the file URL for the DDL script.

public 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 a java.io.Writer configured for output of the DDL script or a string specifying the file URL for the DDL script.

public static final String
SCHEMA_MANAGEMENT_TOOL

Specifies the org.hibernate.tool.schema.spi.SchemaManagementTool to use for performing schema management.

public static final String
STORAGE_ENGINE

Specifies the default storage engine for a relational databases that supports multiple storage engines.

public static final String
UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY

Unique columns and unique keys both use unique constraints in most dialects.

Field Detail

BULK_ID_STRATEGY_GLOBAL_TEMPORARY_CREATE_TABLESback to summary
public 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.

Annotations
@Deprecated
forRemoval:true
BULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLESback to summary
public static final String BULK_ID_STRATEGY_GLOBAL_TEMPORARY_DROP_TABLES

Deprecated

for removal.

Use GlobalTemporaryTableStrategy#DROP_ID_TABLES.

Allows dropping of global temporary tables at application shutdown to be disabled. By default, table dropping is enabled.

Annotations
@Deprecated
forRemoval:true
BULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLESback to summary
public static final String BULK_ID_STRATEGY_LOCAL_TEMPORARY_DROP_TABLES

Deprecated

for removal.

Use LocalTemporaryTableStrategy#DROP_ID_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.

Annotations
@Deprecated
forRemoval:true
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLESback to summary
public static final String BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_CREATE_TABLES

Deprecated

for removal.

Use PersistentTableStrategy#CREATE_ID_TABLES.

Allows creation of persistent temporary tables at application startup to be disabled. By default, table creation is enabled.

Annotations
@Deprecated
forRemoval:true
BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLESback to summary
public static final String BULK_ID_STRATEGY_PERSISTENT_TEMPORARY_DROP_TABLES

Deprecated

for removal.

Use PersistentTableStrategy#DROP_ID_TABLES.

Allows dropping of persistent temporary tables at application shutdown to be disabled. By default, table dropping is enabled.

Annotations
@Deprecated
forRemoval:true
ENABLE_SYNONYMSback to summary
public 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.

EXTRA_PHYSICAL_TABLE_TYPESback to summary
public 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
HBM2DDL_AUTOback to summary
public static final String HBM2DDL_AUTO

Setting to perform org.hibernate.tool.schema.spi.SchemaManagementTool actions automatically as part of the org.hibernate.SessionFactory lifecycle. Valid options are enumerated by org.hibernate.tool.schema.Action.

Interpreted in combination with JAKARTA_HBM2DDL_DATABASE_ACTION and JAKARTA_HBM2DDL_SCRIPTS_ACTION. If no value is specified, the default is "none".

See Also
org.hibernate.tool.schema.Action
HBM2DDL_CHARSET_NAMEback to summary
public 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
HBM2DDL_CREATE_NAMESPACESback to summary
public static final String HBM2DDL_CREATE_NAMESPACES

Deprecated

The JPA-standard setting JAKARTA_HBM2DDL_CREATE_SCHEMAS is now preferred.

Specifies whether to automatically create also the database schema/catalog. The default is false.

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
Since
5.0
HBM2DDL_CREATE_SCHEMASback to summary
public static final String HBM2DDL_CREATE_SCHEMAS

Deprecated

Use JAKARTA_HBM2DDL_CREATE_SCHEMAS instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
HBM2DDL_CREATE_SCRIPT_SOURCEback to summary
public static final String HBM2DDL_CREATE_SCRIPT_SOURCE
Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
HBM2DDL_CREATE_SOURCEback to summary
public static final String HBM2DDL_CREATE_SOURCE

Deprecated

Migrate to JAKARTA_HBM2DDL_CREATE_SOURCE instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
See Also
org.hibernate.tool.schema.SourceType
HBM2DDL_DATABASE_ACTIONback to summary
public static final String HBM2DDL_DATABASE_ACTION

Deprecated

Use JAKARTA_HBM2DDL_DATABASE_ACTION instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
HBM2DDL_DEFAULT_CONSTRAINT_MODEback to summary
public static final String HBM2DDL_DEFAULT_CONSTRAINT_MODE

Used with the jakarta.persistence.ConstraintMode#PROVIDER_DEFAULT strategy for foreign key mapping.

Valid values are jakarta.persistence.ConstraintMode#CONSTRAINT and jakarta.persistence.ConstraintMode#NO_CONSTRAINT.

Since
5.4
HBM2DDL_DELIMITERback to summary
public static final String HBM2DDL_DELIMITER

Identifies the delimiter to use to separate schema management statements in script outputs.

HBM2DDL_DROP_SCRIPT_SOURCEback to summary
public static final String HBM2DDL_DROP_SCRIPT_SOURCE

Deprecated

Migrate to JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
HBM2DDL_DROP_SOURCEback to summary
public static final String HBM2DDL_DROP_SOURCE

Deprecated

Migrate to JAKARTA_HBM2DDL_DROP_SOURCE.

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
See Also
org.hibernate.tool.schema.SourceType
HBM2DDL_FILTER_PROVIDERback to summary
public static final String HBM2DDL_FILTER_PROVIDER

Used to specify the org.hibernate.tool.schema.spi.SchemaFilterProvider to be used by create, drop, migrate and validate operations on the database schema. A SchemaFilterProvider 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
HBM2DDL_HALT_ON_ERRORback to summary
public 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
HBM2DDL_IMPORT_FILESback to summary
public static final String HBM2DDL_IMPORT_FILES

Deprecated

The JPA-standard setting JAKARTA_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 or create-drop.

The default value is /import.sql.

Annotations
@Deprecated
HBM2DDL_IMPORT_FILES_SQL_EXTRACTORback to summary
public static final String HBM2DDL_IMPORT_FILES_SQL_EXTRACTOR

The org.hibernate.tool.schema.spi.SqlScriptCommandExtractor implementation to use for parsing source/import files specified by JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE, JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE or HBM2DDL_IMPORT_FILES. Either:

The correct extractor to use depends on the format of the SQL script:

See Also
org.hibernate.tool.schema.internal.script.SingleLineSqlScriptExtractor, org.hibernate.tool.schema.internal.script.MultiLineSqlScriptExtractor
HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGYback to summary
public static final String HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGY

Setting to choose the strategy used to access the JDBC Metadata.

Valid options are defined by org.hibernate.tool.schema.JdbcMetadaAccessStrategy. org.hibernate.tool.schema.JdbcMetadaAccessStrategy#GROUPED is the default.

See Also
org.hibernate.tool.schema.JdbcMetadaAccessStrategy
HBM2DDL_LOAD_SCRIPT_SOURCEback to summary
public static final String HBM2DDL_LOAD_SCRIPT_SOURCE

Deprecated

Use JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
HBM2DDL_SCRIPTS_ACTIONback to summary
public static final String HBM2DDL_SCRIPTS_ACTION

Deprecated

Use JAKARTA_HBM2DDL_SCRIPTS_ACTION instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
HBM2DDL_SCRIPTS_CREATE_APPENDback to summary
public 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.

HBM2DDL_SCRIPTS_CREATE_TARGETback to summary
public static final String HBM2DDL_SCRIPTS_CREATE_TARGET
Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
HBM2DDL_SCRIPTS_DROP_TARGETback to summary
public static final String HBM2DDL_SCRIPTS_DROP_TARGET
Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
JAKARTA_HBM2DDL_CREATE_SCHEMASback to summary
public static final String JAKARTA_HBM2DDL_CREATE_SCHEMAS

The JPA variant of HBM2DDL_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

JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCEback to summary
public static final String JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE

Specifies the CREATE script file as either a java.io.Reader configured for reading the DDL script file or a string designating a file java.net.URL for the DDL script.

Hibernate historically also accepted HBM2DDL_IMPORT_FILES for a similar purpose. This setting is now preferred.

See Also
JAKARTA_HBM2DDL_CREATE_SOURCE, HBM2DDL_IMPORT_FILES
JAKARTA_HBM2DDL_CREATE_SOURCEback to summary
public 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. See org.hibernate.tool.schema.SourceType 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
org.hibernate.tool.schema.SourceType
JAKARTA_HBM2DDL_DATABASE_ACTIONback to summary
public 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 configured org.hibernate.engine.jdbc.connections.spi.ConnectionProvider for the org.hibernate.SessionFactory.

Valid options are enumerated by org.hibernate.tool.schema.Action.

This setting takes precedence over hibernate.hbm2ddl.auto.

If no value is specified, the default is "none".

See Also
org.hibernate.tool.schema.Action, JdbcSettings#JAKARTA_HBM2DDL_CONNECTION, JdbcSettings#JAKARTA_JDBC_URL
JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCEback to summary
public static final String JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE

Specifies the DROP script file as either a java.io.Reader configured for reading the DDL script file or a string designating a file java.net.URL for the DDL script.

See Also
JAKARTA_HBM2DDL_DROP_SOURCE
JAKARTA_HBM2DDL_DROP_SOURCEback to summary
public 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. See org.hibernate.tool.schema.SourceType 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
org.hibernate.tool.schema.SourceType
JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCEback to summary
public static final String JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE

JPA-standard variant of HBM2DDL_IMPORT_FILES for specifying a database initialization script to be run as part of schema-export

Specifies a java.io.Reader configured for reading of the SQL load script or a string designating the java.net.URL for the SQL load script.

JAKARTA_HBM2DDL_SCRIPTS_ACTIONback to summary
public 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 org.hibernate.tool.schema.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
org.hibernate.tool.schema.Action, JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET
JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGETback to summary
public 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 a java.io.Writer configured for output of the DDL script or a string specifying the file URL for the DDL script.

See Also
JAKARTA_HBM2DDL_SCRIPTS_ACTION
JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGETback to summary
public 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 a java.io.Writer configured for output of the DDL script or a string specifying the file URL for the DDL script.

See Also
JAKARTA_HBM2DDL_SCRIPTS_ACTION
SCHEMA_MANAGEMENT_TOOLback to summary
public static final String SCHEMA_MANAGEMENT_TOOL

Specifies the org.hibernate.tool.schema.spi.SchemaManagementTool to use for performing schema management.

By default, org.hibernate.tool.schema.internal.HibernateSchemaManagementTool is used.

Since
5.0
STORAGE_ENGINEback to summary
public 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 an Environment variable or JVM System Property, since the org.hibernate.dialect.Dialect is instantiated before Hibernate property resolution.

Since
5.2.9
UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGYback to summary
public 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.