Annotation Interface Id


@Target(FIELD) @Retention(RUNTIME) public @interface Id
Indicates an entity identifier that is mapped to a primary key of a database table.

The annotated field must be a member of an Entity annotated class.

This annotation marks a field as representing a primary key column in the database table. It can be used in conjunction with GeneratedValue to specify how the identifier should be generated.

 @Entity
 public class Employee {

     @Id
     @Column(name = "ID")
     String id;
     ...
 }
 
See Also: