diff options
author | Dominik Mizyn <d.mizyn@samsung.com> | 2019-06-14 11:28:52 +0200 |
---|---|---|
committer | Dominik Mizyn <d.mizyn@samsung.com> | 2019-06-14 11:28:57 +0200 |
commit | 4491bf16d2ecf2a413b7417ed82929e5f77d2528 (patch) | |
tree | abc064643d2b8660d6793cbc3ddca132f98e0196 /ecomp-portal-widget-ms | |
parent | 2bf888ea77e56b00e4638a1fe80289f09f2bfec6 (diff) |
WidgetFileApp class DB constraints
Java Bean Validation SR 380 annotations added to classes
Issue-ID: PORTAL-633
Change-Id: Id7b45dedafe2e5f9e799a93d219baef46c88d124
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/WidgetFile.java | 69 |
1 files changed, 13 insertions, 56 deletions
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java index e9c6ffc2..7ba22982 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java @@ -4,18 +4,31 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +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_files") +@Getter +@Setter public class WidgetFile { @Id @Column (name = "file_id") + @Digits(integer = 11, fraction = 0) private int id; @Column(name = "widget_name") + @Size(max = 11) + @SafeHtml + @NotNull private String name; @Column(name = "widget_id") + @Digits(integer = 11, fraction = 0) private long widgetId; @Column(name = "markup_html") @@ -30,62 +43,6 @@ public class WidgetFile { @Column(name = "widget_css") private byte[] css; - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public byte[] getMarkup() { - return markup; - } - - public void setMarkup(byte[] markup) { - this.markup = markup; - } - - public byte[] getController() { - return controller; - } - - public void setController(byte[] controller) { - this.controller = controller; - } - - public byte[] getFramework() { - return framework; - } - - public void setFramework(byte[] framework) { - this.framework = framework; - } - - public byte[] getCss() { - return css; - } - - public void setCss(byte[] css) { - this.css = css; - } - - public long getWidgetId() { - return widgetId; - } - - public void setWidgetId(long widgetId) { - this.widgetId = widgetId; - } - @Override public String toString() { return "WidgetFile [name=" + name + ", widgetId=" + widgetId + "]"; |