From 619fa557767cd4205a89349c5f281c5d2de50041 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Wed, 14 Oct 2020 12:10:41 +0300 Subject: [PATCH] User username & password: add NotBlank constraint annotation Signed-off-by: Pekka Helenius --- .../src/main/java/com/fjordtek/bookstore/model/auth/User.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/User.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/User.java index 5a03895..56118fd 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/User.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/User.java @@ -16,6 +16,7 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -62,6 +63,7 @@ public class User { nullable = false, columnDefinition = "NVARCHAR(" + strMax + ")" ) + @NotBlank private String username; /* @@ -73,6 +75,7 @@ public class User { columnDefinition = "NVARCHAR(" + strMaxPasswd + ")" ) @JsonIgnore + @NotBlank private String password; @Email