Enum Class SequenceMismatchStrategy

java.lang.Object
java.lang.Enum<SequenceMismatchStrategy>
org.hibernate.id.SequenceMismatchStrategy
All Implemented Interfaces:
Serializable, Comparable<SequenceMismatchStrategy>, Constable

public enum SequenceMismatchStrategy extends Enum<SequenceMismatchStrategy>
Describes the strategy for handling the mismatch between a database sequence configuration and the one defined by the entity mapping.
See Also:
  • Enum Constant Details

    • LOG

      public static final SequenceMismatchStrategy LOG
      When detecting a mismatch, Hibernate simply logs the sequence whose entity mapping configuration conflicts with the one found in the database.
    • EXCEPTION

      public static final SequenceMismatchStrategy EXCEPTION
      When detecting a mismatch, Hibernate throws a MappingException indicating the sequence whose entity mapping configuration conflict with the one found in the database.
    • FIX

      public static final SequenceMismatchStrategy FIX
      When detecting a mismatch, Hibernate tries to fix it by overriding the entity sequence mapping using the one found in the database.
    • NONE

      public static final SequenceMismatchStrategy NONE
      Don't perform any check. This is useful to speedup bootstrap as it won't query the sequences on the DB, at cost of not validating the sequences.
  • Method Details

    • values

      public static SequenceMismatchStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SequenceMismatchStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • interpret

      public static SequenceMismatchStrategy interpret(@Nullable Object sequenceMismatchStrategy)
      Interpret the configured SequenceMismatchStrategy value.

      Valid values are either a SequenceMismatchStrategy object or its String representation.

      For string values, the matching is case insensitive, so you can use either FIX or fix.

      Parameters:
      sequenceMismatchStrategy - configured SequenceMismatchStrategy representation
      Returns:
      associated SequenceMismatchStrategy object