Jakarta Persistence (JPA) Annotation Type

jakarta.persistence.CheckConstraint

Implemented Interfaces:
Annotation

Used to specify a SQL check constraint on a column or table when schema generation is in effect.
See Also:
Since:
Jakarta Persistence (JPA) 3.2

Annotation Elements

String name
(Optional) The name of the constraint.

Defaults to a provider-generated name.

Default:
""
Since:
Jakarta Persistence (JPA) 1.0
String constraint
(Required) The native SQL expression to be checked.
Since:
Jakarta Persistence (JPA) 1.0
String options
(Optional) A SQL fragment appended to the generated DDL which creates this constraint.
Default:
""
Since:
Jakarta Persistence (JPA) 3.2

Additional JDK methods inherited from java.lang.annotation.Annotation

java.lang.annotation.Annotation/annotationType(), java.lang.annotation.Annotation/equals(Object), java.lang.annotation.Annotation/hashCode(), java.lang.annotation.Annotation/toString()