aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java')
-rw-r--r--ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java46
1 files changed, 23 insertions, 23 deletions
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java
index 677046326..f6512af88 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,6 @@ package org.onap.policy.rest.jpa;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
-
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -68,23 +67,6 @@ public class PolicyVersion implements Serializable {
@Column(name="created_date", nullable=false)
private Date createdDate;
-
- public int getActiveVersion() {
- return activeVersion;
- }
-
- public void setActiveVersion(int activeVersion) {
- this.activeVersion = activeVersion;
- }
-
- public int getHigherVersion() {
- return higherVersion;
- }
-
- public void setHigherVersion(int higherVersion) {
- this.higherVersion = higherVersion;
- }
-
@Column(name="CREATED_BY", nullable=false, length=45)
private String createdBy;
@@ -96,6 +78,11 @@ public class PolicyVersion implements Serializable {
@Column(name="modified_by", nullable=false, length=45)
private String modifiedBy;
+ public PolicyVersion() {
+ this.modifiedDate = new Date();
+ this.createdDate = new Date();
+ }
+
public PolicyVersion(String domain, String loginUserId) {
this(domain);
this.createdBy = loginUserId;
@@ -106,10 +93,23 @@ public class PolicyVersion implements Serializable {
this.policyName = domain;
}
- public PolicyVersion(){
- // Empty constructor
+ public int getActiveVersion() {
+ return activeVersion;
}
+ public void setActiveVersion(int activeVersion) {
+ this.activeVersion = activeVersion;
+ }
+
+ public int getHigherVersion() {
+ return higherVersion;
+ }
+
+ public void setHigherVersion(int higherVersion) {
+ this.higherVersion = higherVersion;
+ }
+
+
@PrePersist
public void prePersist() {
Date date = new Date();