From 8ed96608658e65670b6846e1c2d131021b6a18dd Mon Sep 17 00:00:00 2001 From: Dominik Mizyn Date: Thu, 13 Jun 2019 16:22:28 +0200 Subject: App class DB constraints Java Bean Validation SR 380 annotations added to classes Issue-ID: PORTAL-627 Change-Id: I827f99ef75c6af3f9881fe68f1cb245795ba2734 Signed-off-by: Dominik Mizyn --- .../src/main/java/org/onap/portalapp/widget/domain/App.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap') diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java index d950d035..212826cd 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java @@ -8,6 +8,10 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; +import javax.validation.constraints.Digits; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import org.hibernate.validator.constraints.SafeHtml; @Entity @Table(name = "FN_APP") @@ -18,9 +22,13 @@ public class App implements Serializable{ @Id @Column(name = "APP_ID") @GeneratedValue(strategy=GenerationType.AUTO) + @Digits(integer = 11, fraction = 0) private Long appId; - + @Column(name = "APP_Name") + @SafeHtml + @Size(max = 100) + @NotNull private String appName; public Long getAppId() { -- cgit 1.2.3-korg