Package org.hibernate.tool.schema
Enum SourceType
- java.lang.Object
-
- java.lang.Enum<SourceType>
-
- org.hibernate.tool.schema.SourceType
-
- All Implemented Interfaces:
Serializable
,Comparable<SourceType>
public enum SourceType extends Enum<SourceType>
Enumerates the various types of sources understood by the schema management tooling.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description METADATA
The ORM metadata is used as the exclusive source generation of for DDL commands.METADATA_THEN_SCRIPT
Both the ORM metadata and external DDL scripts are used as sources for generation, with the commands from the external DDL script(s) being executed last.SCRIPT
External DDL script(s) are used as the exclusive source for DDL commands.SCRIPT_THEN_METADATA
Both the O/M metadata and external DDL scripts are used as sources for generation, with the commands from the external DDL script(s) being executed first.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SourceType
interpret(Object value, SourceType defaultValue)
Used when processing JPA configuration to interpret the user config valuestatic SourceType
valueOf(String name)
Returns the enum constant of this type with the specified name.static SourceType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
METADATA
public static final SourceType METADATA
The ORM metadata is used as the exclusive source generation of for DDL commands.
-
SCRIPT
public static final SourceType SCRIPT
External DDL script(s) are used as the exclusive source for DDL commands.The scripts for schema creation and dropping come from different sources:
- The creation DDL script is identified by the setting "jakarta.persistence.schema-generation.create-script-source".
- The drop DDL script is identified by the setting "jakarta.persistence.schema-generation.drop-script-source".
-
METADATA_THEN_SCRIPT
public static final SourceType METADATA_THEN_SCRIPT
Both the ORM metadata and external DDL scripts are used as sources for generation, with the commands from the external DDL script(s) being executed last.
-
SCRIPT_THEN_METADATA
public static final SourceType SCRIPT_THEN_METADATA
Both the O/M metadata and external DDL scripts are used as sources for generation, with the commands from the external DDL script(s) being executed first.
-
-
Method Detail
-
values
public static SourceType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SourceType c : SourceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SourceType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
interpret
public static SourceType interpret(Object value, SourceType defaultValue)
Used when processing JPA configuration to interpret the user config value- Parameters:
value
- The encountered user config value- Returns:
- The matching enum value. An empty value will return
null
. - Throws:
IllegalArgumentException
- If the incoming value is unrecognized
-
-