From 6269a9c549bc5659f6cb0701c335acce320e5c00 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Wed, 14 Oct 2020 12:36:37 +0300 Subject: [PATCH] User_Role composite key: add NotNull constraint annotation Signed-off-by: Pekka Helenius --- .../fjordtek/bookstore/model/auth/UserRoleCompositeKey.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/UserRoleCompositeKey.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/UserRoleCompositeKey.java index fa15aa2..7249c14 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/UserRoleCompositeKey.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/auth/UserRoleCompositeKey.java @@ -6,6 +6,7 @@ import java.io.Serializable; import java.util.Objects; import javax.persistence.Embeddable; +import javax.validation.constraints.NotNull; /** * This class implements a composite primary key based on @@ -21,8 +22,9 @@ public class UserRoleCompositeKey implements Serializable { private static final long serialVersionUID = 2889337731246989510L; + @NotNull private Long userId; - + @NotNull private Long roleId; ////////////////////