Rename keywords used as column names in API and PAP JPA 72/116872/4
authorgregory.hayes <gregory.hayes@est.tech>
Wed, 13 Jan 2021 20:35:46 +0000 (20:35 +0000)
committergregory.hayes <gregory.hayes@est.tech>
Thu, 14 Jan 2021 18:10:03 +0000 (18:10 +0000)
Using keywords as column names in JPA models is causing syntax errors during auto generation of DDL
The errors are visible in the policy api and pap docker logs on startup
This review renames the relevant columns

Issue-ID: POLICY-2670
Signed-off-by: gregory.hayes <gregory.hayes@est.tech>
Change-Id: I52a3156461940465c3945841c69a04fcb2f90117

models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTrigger.java

index 4420639..cd29616 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@ public class JpaToscaProperty extends PfConcept implements PfAuthorative<ToscaPr
     @Column
     private boolean required = false;
 
-    @Column(name = "default")
+    @Column
     @NotBlank
     private String defaultValue;
 
index 677354d..546ea07 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -84,11 +84,11 @@ public class JpaToscaTrigger extends PfConcept {
     @Valid
     private JpaToscaEventFilter targetFilter;
 
-    @Column
+    @Column(name = "toscaCondition")
     @Valid
     private JpaToscaConstraint condition;
 
-    @Column
+    @Column(name = "toscaConstraint")
     @Valid
     private JpaToscaConstraint constraint;