Upgrade the H2 database to the latest version
[policy/models.git] / models-pdp / src / main / java / org / onap / policy / models / pdp / persistence / concepts / JpaPdpPolicyStatus.java
index 2da787b..88fb14a 100644 (file)
@@ -52,7 +52,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
  * Class to represent PDP-Policy deployment status in the database.
  */
 @Entity
-@Table(name = "JpaPdpPolicyStatus", indexes = {@Index(name = "JpaPdpPolicyStatus_PdpGroup", columnList = "pdpGroup")})
+@Table(name = "PdpPolicyStatus", indexes = {@Index(name = "PdpPolicyStatus_PdpGroup", columnList = "pdpGroup")})
 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -82,7 +82,7 @@ public class JpaPdpPolicyStatus extends PfConcept implements PfAuthorative<PdpPo
     @VerifyKey(versionNotNull = true)
     private PfConceptKey policyType;
 
-    @Column
+    @Column(columnDefinition = "TINYINT DEFAULT 1")
     private boolean deploy;
 
     @Column
@@ -154,10 +154,8 @@ public class JpaPdpPolicyStatus extends PfConcept implements PfAuthorative<PdpPo
     @Override
     public PdpPolicyStatus toAuthorative() {
         PfConceptKey policyKey = key.getParentConceptKey();
-        ToscaConceptIdentifier policyIdent = new ToscaConceptIdentifier(policyKey.getName(), policyKey.getVersion());
-
-        ToscaConceptIdentifier policyTypeIdent =
-                        new ToscaConceptIdentifier(policyType.getName(), policyType.getVersion());
+        var policyIdent = new ToscaConceptIdentifier(policyKey.getName(), policyKey.getVersion());
+        var policyTypeIdent = new ToscaConceptIdentifier(policyType.getName(), policyType.getVersion());
 
         // @formatter:off
         return PdpPolicyStatus.builder()