Top Description Methods
javax.persistence

public @Interface UniqueConstraint

extends Annotation
Annotations
@Target
@Retention:RUNTIME
Imports
java.lang.annotation.Target, .Retention

Specifies that a unique constraint is to be included in the generated DDL for a primary or secondary table.
   Example:
   @Entity
   @Table(
       name="EMPLOYEE", 
       uniqueConstraints=
           @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
   )
   public class Employee { ... }
Since
Java Persistence 1.0

Method Summary

Modifier and TypeMethod and Description
public String[]
columnNames()

(Required) An array of the column names that make up the constraint.

public String
name()

(Optional) Constraint name.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

columnNamesback to summary
public String[] columnNames()

(Required) An array of the column names that make up the constraint.

nameback to summary
public String name()

(Optional) Constraint name. A provider-chosen name will be chosen if a name is not specified.

Since
Java Persistence 2.0