From 673cd993f419209da348e2c806b2dc7528952fe2 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Wed, 14 Oct 2020 12:17:25 +0300 Subject: [PATCH] Role name: add NotBlank constraint annotation Signed-off-by: Pekka Helenius --- .../src/main/java/com/fjordtek/bookstore/model/auth/Role.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/Role.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/Role.java index d45c4ee..c80c67a 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/Role.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/Role.java @@ -15,6 +15,7 @@ import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; +import javax.validation.constraints.NotBlank; /** * This class implements Role entity which forms @@ -49,6 +50,7 @@ public class Role { nullable = false, columnDefinition = "VARCHAR(20)" ) + @NotBlank private String name; @OneToMany(