All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.persistence.UniqueConstraint Maven / Gradle / Ivy

package javax.persistence;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * 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 */ @Target({}) @Retention(RUNTIME) public @interface UniqueConstraint { /** * (Required) An array of the column names that make up the constraint. */ String[] columnNames(); /** * (Optional) Constraint name. A provider-chosen name will be chosen if a name is not specified. * * @since Java Persistence 2.0 */ String name() default ""; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy