summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db/src
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-02-25 13:53:18 +0000
committerGerrit Code Review <gerrit@onap.org>2019-02-25 13:53:18 +0000
commit9dfac1f8a822ef3e904f5f594120e9d8d450e248 (patch)
tree808e33ba6a08d07f08f671691e483b842aca011f /mso-api-handlers/mso-requests-db/src
parent489b742f855a9248afbbd442eb70c52ba3b36ecc (diff)
parent20e1b6517b1c64a82cb52be8a2a2882c86b1318b (diff)
Merge "Prevent race conditions on same distributionId."
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src')
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java
index 40c81b96e7..69d84b7679 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java
@@ -31,6 +31,8 @@ import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import javax.persistence.Version;
+
import java.util.Objects;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -54,6 +56,9 @@ public class WatchdogDistributionStatus implements Serializable {
@Column(name = "MODIFY_TIME")
@Temporal(TemporalType.TIMESTAMP)
private Date modifyTime;
+ @Version
+ @Column(name = "LOCK_VERSION")
+ private int version;
public WatchdogDistributionStatus() {
@@ -78,7 +83,15 @@ public class WatchdogDistributionStatus implements Serializable {
public void setDistributionIdStatus(String distributionIdStatus) {
this.distributionIdStatus = distributionIdStatus;
}
-
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
public Date getCreateTime() {
return createTime;
}