枚举 Action
- java.lang.Object
-
- java.lang.Enum<Action>
-
- org.hibernate.tool.schema.Action
-
- 所有已实现的接口:
Serializable,Comparable<Action>
public enum Action extends Enum<Action>
The allowable actions in terms of schema tooling. Covers the unified JPA and HBM2DDL cases.- 作者:
- Steve Ebersole
-
-
枚举常量概要
枚举常量 枚举常量 说明 CREATEDatabase dropping will be generated followed by database creation.CREATE_DROPDrop the schema and recreate it on SessionFactory startup.CREATE_ONLYDatabase creation will be generated.DROPDatabase dropping will be generated.NONENo action will be performed.UPDATE"update" (Hibernate only) - update (alter) the database schemaVALIDATE"validate" (Hibernate only) - validate the database schema
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static ActioninterpretHbm2ddlSetting(Object value)Used to interpret the value ofAvailableSettings.HBM2DDL_AUTOstatic ActioninterpretJpaSetting(Object value)Used when processing JPA configuration to interpret the user config values.StringtoString()static ActionvalueOf(String name)返回带有指定名称的该类型的枚举常量。static Action[]values()按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。
-
-
-
枚举常量详细资料
-
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 toCREATECorresponds 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 toSchemaDropperfollowed 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
-
-
方法详细资料
-
values
public static Action[] values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:for (Action c : Action.values()) System.out.println(c);
- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
-
valueOf
public static Action valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- 如果该枚举类型没有带有指定名称的常量NullPointerException- 如果参数为空值
-
interpretJpaSetting
public static Action interpretJpaSetting(Object value)
Used when processing JPA configuration to interpret the user config values. Generally this will be a value specified byAvailableSettings.HBM2DDL_DATABASE_ACTIONorAvailableSettings.HBM2DDL_SCRIPTS_ACTION- 参数:
value- The encountered config value- 返回:
- The matching enum value. An empty value will return
NONE. - 抛出:
IllegalArgumentException- If the incoming value is unrecognized
-
interpretHbm2ddlSetting
public static Action interpretHbm2ddlSetting(Object value)
Used to interpret the value ofAvailableSettings.HBM2DDL_AUTO- 参数:
value- The encountered config value- 返回:
- The matching enum value. An empty value will return
NONE. - 抛出:
IllegalArgumentException- If the incoming value is unrecognized
-
-