Enum Action

    • Enum Constant Detail

      • NONE

        public static final Action NONE
        No action.

        Valid in JPA; compatible with Hibernate's HBM2DDL action of the same name.

      • CREATE_ONLY

        public static final Action CREATE_ONLY
        Create the schema.

        This is an action introduced by JPA; Hibernate's legacy HBM2DDL had no such action. Its "create" action was actually equivalent to CREATE.

        See Also:
        SchemaCreator
      • DROP

        public static final Action DROP
        Drop the schema.

        Valid in JPA; compatible with Hibernate's HBM2DDL action of the same name.

        See Also:
        SchemaDropper
      • CREATE_DROP

        public static final Action CREATE_DROP
        Drop the schema and then recreate it on SessionFactory startup. Additionally, drop the schema on SessionFactory shutdown.

        This action is not defined by JPA.

        While this is a valid option for auto schema tooling, it's not a valid action for the SchemaManagementTool; instead the caller of SchemaManagementTool must split this into two separate requests to:

        1. drop and create the schema, and then
        2. later, drop the schema again.
        See Also:
        SchemaDropper, SchemaCreator
      • VALIDATE

        public static final Action VALIDATE
        Validate the database schema.

        This action is not defined by JPA.

        See Also:
        SchemaValidator
      • UPDATE

        public static final Action UPDATE
        Update (alter) the database schema.

        This action is not defined by JPA.

        See Also:
        SchemaMigrator
      • TRUNCATE

        public static final Action TRUNCATE
        Truncate the tables in the schema.

        This action is not defined by JPA.

        Since:
        6.2
        See Also:
        SchemaTruncator
    • 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​(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 name
        NullPointerException - if the argument is null
      • getExternalJpaName

        public String getExternalJpaName()
      • getExternalHbm2ddlName

        public String getExternalHbm2ddlName()
      • interpretHbm2ddlSetting

        public static Action interpretHbm2ddlSetting​(Object value)
        Used to interpret the value of "hibernate.hbm2ddl.auto"
        Parameters:
        value - The encountered config value
        Returns:
        The matching enum value. An empty value will return NONE.
        Throws:
        IllegalArgumentException - If the incoming value is unrecognized