Enum Class UniqueConstraintSchemaUpdateStrategy

java.lang.Object
java.lang.Enum<UniqueConstraintSchemaUpdateStrategy>
org.hibernate.tool.schema.UniqueConstraintSchemaUpdateStrategy
All Implemented Interfaces:
Serializable, Comparable<UniqueConstraintSchemaUpdateStrategy>, Constable

public enum UniqueConstraintSchemaUpdateStrategy extends Enum<UniqueConstraintSchemaUpdateStrategy>
Unique columns and unique keys both use unique constraints in most dialects. SchemaUpdate needs to create these constraints, but DB's support for finding existing constraints is extremely inconsistent. Further, non-explicitly-named unique constraints use randomly generated characters.
  • Enum Constant Details

    • DROP_RECREATE_QUIETLY

      public static final UniqueConstraintSchemaUpdateStrategy DROP_RECREATE_QUIETLY
      Attempt to drop, then (re-)create each unique constraint. Ignore any exceptions thrown. Note that this will require unique keys/constraints to be explicitly named. If Hibernate generates the names (randomly), the drop will not work. DEFAULT
    • RECREATE_QUIETLY

      public static final UniqueConstraintSchemaUpdateStrategy RECREATE_QUIETLY
      Attempt to (re-)create unique constraints, ignoring exceptions thrown (e.g., if the constraint already existed)
    • SKIP

      public static final UniqueConstraintSchemaUpdateStrategy SKIP
      Do not attempt to create unique constraints on a schema update
  • Method Details