public enum Action extends Enum<Action>
The allowable actions in terms of schema tooling. Covers the unified JPA and HBM2DDL cases.
Enum Constant and 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 schema
|
VALIDATE
"validate" (Hibernate only) - validate the database schema
|
Modifier and Type | Method and Description |
---|---|
static Action |
interpretHbm2ddlSetting(Object value)
Used to interpret the value of
AvailableSettings.HBM2DDL_AUTO |
static Action |
interpretJpaSetting(Object value)
Used when processing JPA configuration to interpret the user config values.
|
String |
toString() |
static Action |
valueOf(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.
|
public static final Action NONE
No action will be performed. Valid in JPA; compatible with Hibernate’s hbm2ddl action of the same name..
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 to CREATE
<p/>
Corresponds to a call to SchemaCreator
public static final Action DROP
Database dropping will be generated.
<p/>
Corresponds to a call to SchemaDropper
public static final Action CREATE
Database dropping will be generated followed by database creation.
<p/>
Corresponds to a call to SchemaDropper
followed immediately by a call to SchemaCreator
public static final Action CREATE_DROP
Drop the schema and recreate it on SessionFactory startup. Additionally, drop the schema on SessionFactory shutdown. <p/> Has no corresponding call to a SchemaManagementTool delegate. It is equivalent to a
<p/>
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:<ol>
<li>CREATE
</li>
<li>DROP
</li>
</ol>
public static final Action VALIDATE
"validate" (Hibernate only) - validate the database schema
public static final Action UPDATE
"update" (Hibernate only) - update (alter) the database schema
public static Action[] values()
for (Action c : Action.values()) System.out.println(c);
public static Action valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Action interpretJpaSetting(Object value)
Used when processing JPA configuration to interpret the user config values. Generally
this will be a value specified by AvailableSettings.HBM2DDL_DATABASE_ACTION
or AvailableSettings.HBM2DDL_SCRIPTS_ACTION
value
- The encountered config valueNONE
.IllegalArgumentException
- If the incoming value is unrecognizedpublic static Action interpretHbm2ddlSetting(Object value)
Used to interpret the value of AvailableSettings.HBM2DDL_AUTO
value
- The encountered config valueNONE
.IllegalArgumentException
- If the incoming value is unrecognizedCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.