summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2019-06-14 17:07:18 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-14 17:07:18 +0000
commit4b12eacf41dd7866039f1b9059188c619c317ad6 (patch)
tree605945170f65138731f215d5e6afb6c24e6645f3 /ecomp-portal-BE-common/src
parent5f652908e3cffe593c03a4f352ab0d33663b1639 (diff)
parent569390d96ef6c23d9bd1654bf5288f52865af647 (diff)
Merge "FunctionalMenuItem DB constraints fix"
Diffstat (limited to 'ecomp-portal-BE-common/src')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java6
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java17
2 files changed, 15 insertions, 8 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
index e321512a..9900827f 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
@@ -44,6 +44,8 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
@@ -68,10 +70,11 @@ public class FunctionalMenuItemWithAppID{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "MENU_ID")
+ @Digits(integer = 11, fraction = 0)
public Long menuId;
@Column(name = "COLUMN_NUM")
- @Max(value = 99)
+ @Digits(integer = 2, fraction = 0)
@NotNull
public Integer column;
@@ -82,6 +85,7 @@ public class FunctionalMenuItemWithAppID{
public String text;
@Column(name = "PARENT_MENU_ID")
+ @Digits(integer = 11, fraction = 0)
public Integer parentMenuId;
@Column(name = "URL")
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java
index 6848d6ae..14ad2f4c 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java
@@ -47,6 +47,7 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
+import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
@@ -61,30 +62,32 @@ public class FunctionalMenuItem implements Serializable {
private static final long serialVersionUID = 1L;
@Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "MENU_ID")
+ @Digits(integer = 11, fraction = 0)
public Long menuId;
-
+
@Column(name = "COLUMN_NUM")
- @Max(value = 99)
+ @Digits(integer = 2, fraction = 0)
@NotNull
public Integer column;
-
+
@Column(name = "TEXT")
@Max(value = 100)
@SafeHtml
@NotNull
public String text;
-
+
@Column(name = "PARENT_MENU_ID")
+ @Digits(integer = 11, fraction = 0)
public Integer parentMenuId;
-
+
@Column(name = "URL")
@Max(value = 128)
@SafeHtml
@NotNull
public String url;
-
+
@Column(name="ACTIVE_YN")
@Max(value = 1)
@SafeHtml