It is very simple:
Code:
@Document
public class User extends AuditedBean
{
@Id
private String id;
@Indexed( unique = true )
private String email;
private String password;
@Indexed
private String name;
@Indexed
private String surname;
private State state;
// Getters and setters
// ...
}
Where State is an enum and AuditedBean is:
Code:
public abstract class AuditedBean implements Serializable
{
private Date creationDate;
private String creationUserId;
private Date modifiedDate;
private String modifiedUserId;
// Getters and setters
// ...
}
Thank you.