Browse Source

User username & password: add NotBlank constraint annotation

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.4-alpha
Pekka Helenius 4 years ago
parent
commit
619fa55776
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/model/auth/User.java

+ 3
- 0
bookstore/src/main/java/com/fjordtek/bookstore/model/auth/User.java View File

@ -16,6 +16,7 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
import javax.validation.constraints.Email; import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
@ -62,6 +63,7 @@ public class User {
nullable = false, nullable = false,
columnDefinition = "NVARCHAR(" + strMax + ")" columnDefinition = "NVARCHAR(" + strMax + ")"
) )
@NotBlank
private String username; private String username;
/* /*
@ -73,6 +75,7 @@ public class User {
columnDefinition = "NVARCHAR(" + strMaxPasswd + ")" columnDefinition = "NVARCHAR(" + strMaxPasswd + ")"
) )
@JsonIgnore @JsonIgnore
@NotBlank
private String password; private String password;
@Email @Email


Loading…
Cancel
Save