From 3355d9a073767625f31278fb352974910af32de1 Mon Sep 17 00:00:00 2001 From: "MNUSHKIN, DMITRY" Date: Mon, 22 Mar 2021 16:28:13 -0400 Subject: corrected json prop names and included update ts corrected json prop names and included update ts Issue-ID: SO-3603 Signed-off-by: AT&T Open Source Change-Id: Ie00bdb617e54e00b450e556aab57b11e864a0969 --- .../main/java/org/onap/so/db/catalog/beans/CloudIdentity.java | 10 ++++++++-- .../src/main/java/org/onap/so/db/catalog/beans/CloudSite.java | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java index c3617b62c7..36d3c98413 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java @@ -27,6 +27,7 @@ import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.Id; import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -74,7 +75,7 @@ public class CloudIdentity { @Column(name = "PROJECT_DOMAIN_NAME") private String projectDomainName; - @JsonProperty("admin_project_domain_name ") + @JsonProperty("admin_project_domain_name") @BusinessKey @Column(name = "ADMIN_PROJECT_DOMAIN_NAME", nullable = false) private String adminProjectDomainName = "Default"; @@ -94,7 +95,7 @@ public class CloudIdentity { @Column(name = "MEMBER_ROLE") private String memberRole; - @JsonProperty("tenant_metadata") + @JsonProperty("tenant_meta_data") @BusinessKey @Column(name = "TENANT_METADATA") private Boolean tenantMetadata; @@ -136,6 +137,11 @@ public class CloudIdentity { this.updated = new Date(); } + @PreUpdate + protected void onUpdate() { + this.updated = new Date(); + } + public String getId() { return id; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java index 64c4b62b11..f7cb9fe3c4 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java @@ -31,6 +31,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -143,6 +144,11 @@ public class CloudSite { this.updated = new Date(); } + @PreUpdate + protected void onUpdate() { + this.updated = new Date(); + } + public CloudSite(CloudSite site) { this.cloudVersion = site.getCloudVersion(); this.clli = site.getClli(); -- cgit 1.2.3-korg