Package org.hibernate.id
Enum Class SequenceMismatchStrategy
- All Implemented Interfaces:
Serializable
,Comparable<SequenceMismatchStrategy>
,Constable
Describes the strategy for handling the mismatch between a database sequence configuration and
the one defined by the entity mapping.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWhen detecting a mismatch, Hibernate throws aMappingException
indicating the sequence whose entity mapping configuration conflict with the one found in the database.When detecting a mismatch, Hibernate tries to fix it by overriding the entity sequence mapping using the one found in the database.When detecting a mismatch, Hibernate simply logs the sequence whose entity mapping configuration conflicts with the one found in the database.Don't perform any check. -
Method Summary
Modifier and TypeMethodDescriptionstatic SequenceMismatchStrategy
Interpret the configured SequenceMismatchStrategy value.static SequenceMismatchStrategy
Returns the enum constant of this class with the specified name.static SequenceMismatchStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LOG
When detecting a mismatch, Hibernate simply logs the sequence whose entity mapping configuration conflicts with the one found in the database. -
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. -
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
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
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 nameNullPointerException
- if the argument is null
-
interpret
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
-