Enum SequenceMismatchStrategy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SequenceMismatchStrategy>

    public enum SequenceMismatchStrategy
    extends java.lang.Enum<SequenceMismatchStrategy>
    Describes the strategy for handling the mismatch between a database sequence configuration and the one defined by the entity mapping.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      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
      When detecting a mismatch, Hibernate tries to fix it by overriding the entity sequence mapping using the one found in the database.
      LOG
      When detecting a mismatch, Hibernate simply logs the sequence whose entity mapping configuration conflicts with the one found in the database.
      NONE
      Don't perform any check.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SequenceMismatchStrategy interpret​(java.lang.Object sequenceMismatchStrategy)
      Interpret the configured SequenceMismatchStrategy value.
      static SequenceMismatchStrategy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SequenceMismatchStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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 Detail

      • values

        public static SequenceMismatchStrategy[] 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 (SequenceMismatchStrategy c : SequenceMismatchStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SequenceMismatchStrategy valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • interpret

        public static SequenceMismatchStrategy interpret​(java.lang.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