summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms/widget-ms/src
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-06-14 11:43:33 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-06-14 11:43:51 +0200
commit91346e516f078aff100c0df25621f09950118150 (patch)
treefffcd36d19bf57d21beebb50673c8bf8eac8939b /ecomp-portal-widget-ms/widget-ms/src
parent080b554615fb6d67de14bc3ee2a80145e6fe99ef (diff)
MicroserviceParameter class DB constraints
Java Bean Validation SR 380 annotations added to classes Issue-ID: PORTAL-635 Change-Id: Idcca0d46d1779d5fae874aff38cfd7f59f73c9b0 Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'ecomp-portal-widget-ms/widget-ms/src')
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java45
1 files changed, 13 insertions, 32 deletions
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java
index d95d46c6..7207d0ae 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java
@@ -6,6 +6,11 @@ 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.Size;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
/**
* TODO: moved all microservice-related code (domain, controller, service)
@@ -13,54 +18,30 @@ import javax.persistence.Table;
*/
@Entity
@Table(name="EP_MICROSERVICE_PARAMETER")
+@Getter
+@Setter
public class MicroserviceParameter {
@Id
@Column(name = "id")
@GeneratedValue(strategy=GenerationType.AUTO)
+ @Digits(integer = 11, fraction = 0)
private Long id;
@Column(name = "service_id")
+ @Digits(integer = 11, fraction = 0)
private long serviceId;
@Column(name = "para_key")
+ @Size(max = 50)
+ @SafeHtml
private String para_key;
@Column(name = "para_value")
+ @Size(max = 50)
+ @SafeHtml
private String para_value;
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public long getServiceId() {
- return serviceId;
- }
-
- public void setServiceId(long serviceId) {
- this.serviceId = serviceId;
- }
-
- public String getPara_key() {
- return para_key;
- }
-
- public void setPara_key(String para_key) {
- this.para_key = para_key;
- }
-
- public String getPara_value() {
- return para_value;
- }
-
- public void setPara_value(String para_value) {
- this.para_value = para_value;
- }
-
@Override
public String toString() {
return "MicroserviceParameter [serviceId=" + serviceId + ", para_key=" + para_key + ", para_value=" + para_value