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>
Enumeration of the various types of sources understood by various SchemaManagementTooling delegates.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description METADATA
"metadata" - The O/RM metadata is used as the exclusive source for generationMETADATA_THEN_SCRIPT
"metadata-then-script" - Both the O/RM metadata and external DDL scripts are used as sources for generation, with the O/RM metadata being applied first.SCRIPT
"script" - External DDL script(s) are used as the exclusive source for generation.SCRIPT_THEN_METADATA
"script-then-metadata" - Both the O/RM metadata and external DDL scripts are used as sources for generation, with the commands from the external DDL script(s) being applied 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
"metadata" - The O/RM metadata is used as the exclusive source for generation
-
SCRIPT
public static final SourceType SCRIPT
"script" - External DDL script(s) are used as the exclusive source for generation. The scripts for schema creation and dropping come from different sources. The creation DDL script is identified by the "jakarta.persistence.schema-generation.create-script-source" setting; the drop DDL script is identified by the "jakarta.persistence.schema-generation.drop-script-source" setting.
-
METADATA_THEN_SCRIPT
public static final SourceType METADATA_THEN_SCRIPT
"metadata-then-script" - Both the O/RM metadata and external DDL scripts are used as sources for generation, with the O/RM metadata being applied first.
-
SCRIPT_THEN_METADATA
public static final SourceType SCRIPT_THEN_METADATA
"script-then-metadata" - Both the O/RM metadata and external DDL scripts are used as sources for generation, with the commands from the external DDL script(s) being applied 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
-
-