From 29c64b6bc8ad6506454759e68f32ca62d4aa69fc Mon Sep 17 00:00:00 2001 From: vempo Date: Fri, 29 Dec 2017 16:02:49 +0200 Subject: Default constructors in action-api module Change-Id: I0ac01140d94cd55e6e15eabe00361a14866aa43f Issue-ID: SDC-343 Signed-off-by: vempo --- .../openecomp/sdc/action/dao/types/ActionArtifactEntity.java | 7 ++++++- .../org/openecomp/sdc/action/dao/types/ActionEntity.java | 12 ++++++++---- .../sdc/action/dao/types/OpenEcompComponentEntity.java | 6 ++++++ 3 files changed, 20 insertions(+), 5 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main') diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java index 7e56a04e1b..bc34b8dfda 100644 --- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java @@ -41,8 +41,13 @@ public class ActionArtifactEntity { @Column(name = "artifact") private ByteBuffer artifact; + /** + * Every entity class must have a default constructor according to + * + * Definition of mapped classes. + */ public ActionArtifactEntity() { - //Default constructor implementation + // Don't delete! Default constructor is required by DataStax driver } public ActionArtifactEntity(String artifactUuId, int effectiveVersion) { diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java index 2c2bfe3ae9..9d0f3d830d 100644 --- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java @@ -65,7 +65,13 @@ public class ActionEntity { @Column(name = "data") private String data; + /** + * Every entity class must have a default constructor according to + * + * Definition of mapped classes. + */ public ActionEntity() { + // Don't delete! Default constructor is required by DataStax driver } public ActionEntity(String actionInvariantUuId, Version version) { @@ -124,7 +130,7 @@ public class ActionEntity { */ public void setVendorList(List vendorList) { if (vendorList != null && !vendorList.isEmpty()) { - List lowerCaseVendorList = new ArrayList(); + List lowerCaseVendorList = new ArrayList<>(); lowerCaseVendorList .addAll(vendorList.stream().map(String::toLowerCase).collect(Collectors.toList())); this.vendorList = lowerCaseVendorList; @@ -144,7 +150,7 @@ public class ActionEntity { */ public void setCategoryList(List categoryList) { if (categoryList != null && !categoryList.isEmpty()) { - List lowerCaseCategoryList = new ArrayList(); + List lowerCaseCategoryList = new ArrayList<>(); lowerCaseCategoryList .addAll(categoryList.stream().map(String::toLowerCase).collect(Collectors.toList())); this.categoryList = lowerCaseCategoryList; @@ -199,8 +205,6 @@ public class ActionEntity { * @return the action */ public Action toDto() { - //Action destination = new Action(); - Action destination = JsonUtil.json2Object(this.getData(), Action.class); destination.setData(this.getData()); destination.setTimestamp(this.getTimestamp()); diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/OpenEcompComponentEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/OpenEcompComponentEntity.java index 326da718dd..a5025e5de8 100644 --- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/OpenEcompComponentEntity.java +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/OpenEcompComponentEntity.java @@ -35,7 +35,13 @@ public class OpenEcompComponentEntity { @Column(name = "name") private String name; + /** + * Every entity class must have a default constructor according to + * + * Definition of mapped classes. + */ public OpenEcompComponentEntity() { + // Don't delete! Default constructor is required by DataStax driver } public OpenEcompComponentEntity(String id, String name) { -- cgit 1.2.3-korg