From: Dominik Mizyn Date: Thu, 13 Jun 2019 15:10:22 +0000 (+0200) Subject: WidgetCatalog class DB constraints X-Git-Tag: 3.2.0~280^2~3 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=portal.git;a=commitdiff_plain;h=3a922655ab8f6a6a4ed1a006a720b70e5bc21aa8 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 --- 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 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 getWidgetRoles() { - return widgetRoles; - } - - public void setWidgetRoles(Set 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