Annotation Interface Id


@Target(FIELD) @Retention(RUNTIME) public @interface Id

This annotation is used to mark the field in a model class that represents the unique identifier * for the object. If the @Id annotation is not used on any field in the model class, then * the first field of the class will be used as the ID. This annotation can be used in conjunction * with the @Rest annotation to create REST APIs from the model.

Example usage:


 @Rest
 public User {
     @Id
     private String id;
     private String name;
     // ...
 }
 
See Also: