summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2019-06-17 21:24:57 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-17 21:24:57 +0000
commitfd64af5e46b31e731e3e9e11b037361b0a73d965 (patch)
tree7a30e69d6b247314a041dd1810d9f3d94a346c42
parente42eae64a6ed2dbdf9dd1112bb31633faf60e0a3 (diff)
parent91346e516f078aff100c0df25621f09950118150 (diff)
Merge "MicroserviceParameter class DB constraints"
-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