Top Description Fields Constructors Methods
org.hibernate.tool.schema

public final Enum Action

extends Enum<Action>
Class Inheritance
Imports
org.hibernate.internal.util.StringHelper

The allowable actions in terms of schema tooling. Covers the unified JPA and HBM2DDL cases.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final Action
CREATE

Database dropping will be generated followed by database creation.

public static final Action
CREATE_DROP

Drop the schema and recreate it on SessionFactory startup.

public static final Action
CREATE_ONLY

Database creation will be generated.

public static final Action
DROP

Database dropping will be generated.

private final String
private final String
public static final Action
NONE

No action will be performed.

public static final Action
UPDATE

"update" (Hibernate only) - update (alter) the database schema

public static final Action
VALIDATE

"validate" (Hibernate only) - validate the database schema

Constructor Summary

AccessConstructor and Description
private
Action(String externalJpaName)

private
Action(String externalJpaName, String externalHbm2ddlName)

Method Summary

Modifier and TypeMethod and Description
public String
public String
private static Action
public static Action

Returns:

The matching enum value. An empty value will return NONE.
interpretHbm2ddlSetting
(Object
The encountered config value
value
)

Used to interpret the value of org.hibernate.cfg.AvailableSettings#HBM2DDL_AUTO

public static Action

Returns:

The matching enum value. An empty value will return NONE.
interpretJpaSetting
(Object
The encountered config value
value
)

Used when processing JPA configuration to interpret the user config values.

public String
toString()

Overrides java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration.
public static Action
public static Action[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

CREATEback to summary
public static final Action CREATE

Database dropping will be generated followed by database creation.

Corresponds to a call to org.hibernate.tool.schema.spi.SchemaDropper followed immediately by a call to org.hibernate.tool.schema.spi.SchemaCreator

CREATE_DROPback to summary
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:

  1. CREATE
  2. DROP
CREATE_ONLYback to summary
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

Corresponds to a call to org.hibernate.tool.schema.spi.SchemaCreator

DROPback to summary
public static final Action DROP

Database dropping will be generated.

Corresponds to a call to org.hibernate.tool.schema.spi.SchemaDropper

externalHbm2ddlNameback to summary
private final String externalHbm2ddlName
externalJpaNameback to summary
private final String externalJpaName
NONEback to summary
public static final Action NONE

No action will be performed. Valid in JPA; compatible with Hibernate's hbm2ddl action of the same name..

UPDATEback to summary
public static final Action UPDATE

"update" (Hibernate only) - update (alter) the database schema

VALIDATEback to summary
public static final Action VALIDATE

"validate" (Hibernate only) - validate the database schema

Constructor Detail

Actionback to summary
private Action(String externalJpaName)
Actionback to summary
private Action(String externalJpaName, String externalHbm2ddlName)

Method Detail

getExternalHbm2ddlNameback to summary
public String getExternalHbm2ddlName()
getExternalJpaNameback to summary
public String getExternalJpaName()
hbm2ddlSettingback to summary
private static Action hbm2ddlSetting(Action action)
interpretHbm2ddlSettingback to summary
public static Action interpretHbm2ddlSetting(Object value)

Used to interpret the value of org.hibernate.cfg.AvailableSettings#HBM2DDL_AUTO

Parameters
value:Object

The encountered config value

Returns:Action

The matching enum value. An empty value will return NONE.

Exceptions
IllegalArgumentException:
If the incoming value is unrecognized
interpretJpaSettingback to summary
public static Action interpretJpaSetting(Object value)

Used when processing JPA configuration to interpret the user config values. Generally this will be a value specified by org.hibernate.cfg.AvailableSettings#HBM2DDL_DATABASE_ACTION or org.hibernate.cfg.AvailableSettings#HBM2DDL_SCRIPTS_ACTION

Parameters
value:Object

The encountered config value

Returns:Action

The matching enum value. An empty value will return NONE.

Exceptions
IllegalArgumentException:
If the incoming value is unrecognized
toStringback to summary
public String toString()

Overrides java.lang.Enum.toString.

Doc from java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

Returns:String

the name of this enum constant

Annotations
@Override
valueOfback to summary
public static Action valueOf(String name)
valuesback to summary
public static Action[] values()