Package org.hibernate.tool.schema
Enum Action
- java.lang.Object
-
- java.lang.Enum<Action>
-
- org.hibernate.tool.schema.Action
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CREATE
Database dropping will be generated followed by database creation.CREATE_DROP
Drop the schema and recreate it on SessionFactory startup.CREATE_ONLY
Database creation will be generated.DROP
Database dropping will be generated.NONE
No action will be performed.UPDATE
"update" (Hibernate only) - update (alter) the database schemaVALIDATE
"validate" (Hibernate only) - validate the database schema
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Action
interpretHbm2ddlSetting(java.lang.Object value)
Used to interpret the value ofAvailableSettings.HBM2DDL_AUTO
static Action
interpretJpaSetting(java.lang.Object value)
Used when processing JPA configuration to interpret the user config values.java.lang.String
toString()
static Action
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Action[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final Action NONE
No action will be performed. Valid in JPA; compatible with Hibernate's hbm2ddl action of the same name..
-
CREATE_ONLY
public static final Action CREATE_ONLY
Database creation will be generated. This is an action introduced by JPA. Hibernate's legacy hbm2ddl had no such action - its "create" action is actually equivalent toCREATE
Corresponds to a call toSchemaCreator
-
DROP
public static final Action DROP
Database dropping will be generated. Corresponds to a call toSchemaDropper
-
CREATE
public static final Action CREATE
Database dropping will be generated followed by database creation. Corresponds to a call toSchemaDropper
followed immediately by a call toSchemaCreator
-
CREATE_DROP
public static final Action CREATE_DROP
Drop the schema and recreate it on SessionFactory startup. Additionally, drop the schema on SessionFactory shutdown. Has no corresponding call to a SchemaManagementTool delegate. It is equivalent to a While this is a valid option for auto schema tooling, it is not a valid action to pass to SchemaManagementTool; instead it would be expected that the caller to SchemaManagementTool would split this into 2 separate requests for:
-
VALIDATE
public static final Action VALIDATE
"validate" (Hibernate only) - validate the database schema
-
UPDATE
public static final Action UPDATE
"update" (Hibernate only) - update (alter) the database schema
-
-
Method Detail
-
values
public static Action[] 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 (Action c : Action.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Action valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<Action>
-
interpretJpaSetting
public static Action interpretJpaSetting(java.lang.Object value)
Used when processing JPA configuration to interpret the user config values. Generally this will be a value specified byAvailableSettings.HBM2DDL_DATABASE_ACTION
orAvailableSettings.HBM2DDL_SCRIPTS_ACTION
- Parameters:
value
- The encountered config value- Returns:
- The matching enum value. An empty value will return
NONE
. - Throws:
java.lang.IllegalArgumentException
- If the incoming value is unrecognized
-
interpretHbm2ddlSetting
public static Action interpretHbm2ddlSetting(java.lang.Object value)
Used to interpret the value ofAvailableSettings.HBM2DDL_AUTO
- Parameters:
value
- The encountered config value- Returns:
- The matching enum value. An empty value will return
NONE
. - Throws:
java.lang.IllegalArgumentException
- If the incoming value is unrecognized
-
-