Package org.hibernate.id
Enum SequenceMismatchStrategy
- java.lang.Object
-
- java.lang.Enum<SequenceMismatchStrategy>
-
- org.hibernate.id.SequenceMismatchStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<SequenceMismatchStrategy>
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.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXCEPTION
When detecting a mismatch, Hibernate throws aMappingException
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(@Nullable Object sequenceMismatchStrategy)
Interpret the configured SequenceMismatchStrategy value.static SequenceMismatchStrategy
valueOf(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.
-
-
-
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 aMappingException
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(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 nameNullPointerException
- 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
orfix
.- Parameters:
sequenceMismatchStrategy
- configuredSequenceMismatchStrategy
representation- Returns:
- associated
SequenceMismatchStrategy
object
-
-