summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-06-13 17:10:22 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-06-13 17:13:21 +0200
commit3a922655ab8f6a6a4ed1a006a720b70e5bc21aa8 (patch)
tree3cf77855273d0083d333ac4794a6f77238e3d750 /ecomp-portal-widget-ms
parent4750a197efd18dd20d8f99e8cb7912ea6fd18587 (diff)
WidgetCatalog class DB constraints
Java Bean Validation SR 380 annotations added to classes Plains getter/setter converted to lombok annotation Issue-ID: PORTAL-630 Change-Id: Id866ec4bc0dc428adfbb7cdc64fe15f7faf837f7 Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'ecomp-portal-widget-ms')
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java93
1 files changed, 21 insertions, 72 deletions
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java
index 9d153e2a..1dc0582c 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java
@@ -14,30 +14,51 @@ import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
@Entity
@Table(name="EP_WIDGET_CATALOG")
+@Getter
+@Setter
public class WidgetCatalog{
@Id
@Column(name = "widget_id")
@GeneratedValue(strategy=GenerationType.AUTO)
+ @Digits(integer = 11, fraction = 0)
private long id;
@Column(name = "wdg_name")
+ @Size(max = 100)
+ @SafeHtml
+ @NotNull
private String name;
@Column(name = "wdg_desc")
+ @Size(max = 200)
+ @SafeHtml
private String desc;
@Column(name = "wdg_file_loc")
+ @Size(max = 256)
+ @SafeHtml
+ @NotNull
private String fileLocation;
@Column(name = "all_user_flag")
+ @Size(max = 1)
+ @SafeHtml
+ @NotNull
private String allowAllUser;
@Column(name = "service_id")
+ @Digits(integer = 11, fraction = 0)
private Long serviceId;
@Transient
@@ -53,78 +74,6 @@ public class WidgetCatalog{
)
private Set<RoleApp> widgetRoles;
- public long getId() {
- return id;
- }
-
- public void setId(long id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
- public String getFileLocation() {
- return fileLocation;
- }
-
- public void setFileLocation(String fileLocation) {
- this.fileLocation = fileLocation;
- }
-
- public Set<RoleApp> getWidgetRoles() {
- return widgetRoles;
- }
-
- public void setWidgetRoles(Set<RoleApp> widgetRoles) {
- this.widgetRoles = widgetRoles;
- }
-
- public String getAllowAllUser() {
- return allowAllUser;
- }
-
- public void setAllowAllUser(String allowAllUser) {
- this.allowAllUser = allowAllUser;
- }
-
- public String getSortOrder() {
- return sortOrder;
- }
-
- public void setSortOrder(String sortOrder) {
- this.sortOrder = sortOrder;
- }
-
- public String getStatusCode() {
- return statusCode;
- }
-
- public void setStatusCode(String statusCode) {
- this.statusCode = statusCode;
- }
-
- public Long getServiceId() {
- return serviceId;
- }
-
- public void setServiceId(Long serviceId) {
- this.serviceId = serviceId;
- }
-
@Override
public String toString() {
return "WidgetCatalog [id=" + id + ", name=" + name + ", desc=" + desc + ", fileLocation=" + fileLocation