Package org.hibernate.annotations
Annotation Type NotFound
-
@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface NotFound
Indicates that an association maps to a foreign key column without a foreign key constraint, and which thus potentially violates referential integrity.The
action()
specifies how Hibernate should handle the case of an orphaned foreign key with no associated row in the referenced table.NotFoundAction.EXCEPTION
specifies that this situation should be treated as an error, andNotFoundAction.IGNORE
specifies that this situation should be treated as if the foreign key were null.
This annotation implies
ConstraintMode.NO_CONSTRAINT
for the purposes of DDL generation. That is, a foreign key constraint will not be included in the generated DDL.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description NotFoundAction
action
Specifies how to handle the case of an orphaned foreign key.
-
-
-
Element Detail
-
action
NotFoundAction action
Specifies how to handle the case of an orphaned foreign key.By default, an exception is thrown.
- Default:
- org.hibernate.annotations.NotFoundAction.EXCEPTION
-
-