August 2017
Intermediate to advanced
142 pages
3h
English
© Jorge Acetozi 2017
Jorge Acetozi, Pro Java Clustering and Scalability, https://doi.org/10.1007/978-1-4842-2985-9_16
Jorge Acetozi1
(1)São Paulo / SP, Brazil
The following code is the User class . Along with the attributes declaration, you use the Bean Validation1 and Hibernate Validator2 annotations. A valid new user must have the following:
username: This must not be empty and must have between 5 and 15 characters. This field is the user database table’s primary key.
password: This must not be empty and must have a minimum of five characters.
name: This must not be empty.
email: This must not be empty and must be a valid e-mail address.
@Entity@Table(name = "user")public class User { @Id @NotEmpty @Size(min = 5, max = 15)Read now
Unlock full access