Package org.hibernate.annotations
Enum Class NotFoundAction
- All Implemented Interfaces:
Serializable
,Comparable<NotFoundAction>
,java.lang.constant.Constable
Specifies how Hibernate should handle the case of an orphaned foreign
key with no associated row in the referenced table. This is a situation
that can only occur in a database with missing foreign key constraints.
When a database lacks foreign key constraints, it's normal for it to
accumulate data with referential integrity violations over time.
Alternatively, this situation is also sometimes encountered in legacy
foreign key schemes where some "magic value", instead of NULL
,
indicates a missing reference.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic NotFoundAction
Returns the enum constant of this class with the specified name.static NotFoundAction[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EXCEPTION
Raise an exception when a foreign key value has no corresponding primary key value in the referenced table. -
IGNORE
Treat a foreign key value with no corresponding primary key value in the referenced table as a null reference.
-
-
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
-