Default constructors in vendor-license-api module 63/27163/2
authorvempo <vitaliy.emporopulo@amdocs.com>
Fri, 29 Dec 2017 14:59:26 +0000 (16:59 +0200)
committerAvi Gaffa <avi.gaffa@amdocs.com>
Sun, 31 Dec 2017 07:58:06 +0000 (07:58 +0000)
Change-Id: I27d68b0e9d2eb73e044a11433358f697d692cd4a
Issue-ID: SDC-343
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java

index 6c4ba90..4bcfd9d 100644 (file)
@@ -44,7 +44,7 @@ import java.util.Set;
 @Table(keyspace = "dox", name = "entitlement_pool")
 public class EntitlementPoolEntity implements VersionableEntity {
 
-  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
   private static final String ENTITY_TYPE = "Entitlement Pool";
 
   @PartitionKey
@@ -89,7 +89,13 @@ public class EntitlementPoolEntity implements VersionableEntity {
   //Defined and used only for License Artifcat XMLs
   private String manufacturerReferenceNumber;
 
+  /**
+   * Every entity class must have a default constructor according to
+   * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
+   * Definition of mapped classes</a>.
+   */
   public EntitlementPoolEntity() {
+    // Don't delete! Default constructor is required by DataStax driver
   }
 
   /**
@@ -381,11 +387,11 @@ public class EntitlementPoolEntity implements VersionableEntity {
   }
 
   public String getIsoFormatStartDate() {
-    mdcDataDebugMessage.debugEntryMessage("start date", startDate);
+    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("start date", startDate);
     String isoFormatStartDate = null;
     if (!StringUtils.isEmpty(startDate)) {
       isoFormatStartDate = VendorLicenseUtil.getIsoFormatDate(startDate);
-      mdcDataDebugMessage.debugExitMessage("start date", "iso format start date", startDate,
+      MDC_DATA_DEBUG_MESSAGE.debugExitMessage("start date", "iso format start date", startDate,
           isoFormatStartDate);
     }
     return isoFormatStartDate;
@@ -393,11 +399,11 @@ public class EntitlementPoolEntity implements VersionableEntity {
 
 
   public String getIsoFormatExpiryDate() {
-    mdcDataDebugMessage.debugEntryMessage("expiry date", expiryDate);
+    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("expiry date", expiryDate);
     String isoFormatExpDate = null;
     if (!StringUtils.isEmpty(expiryDate)) {
       isoFormatExpDate = VendorLicenseUtil.getIsoFormatDate(expiryDate);
-      mdcDataDebugMessage.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
+      MDC_DATA_DEBUG_MESSAGE.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
           isoFormatExpDate);
     }
     return isoFormatExpDate;
index f1fc1a9..5706412 100644 (file)
@@ -58,7 +58,13 @@ public class FeatureGroupEntity implements VersionableEntity {
   @Column(name = "ref_la_ids")
   private Set<String> referencingLicenseAgreements = new HashSet<>();
 
+  /**
+   * Every entity class must have a default constructor according to
+   * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
+   * Definition of mapped classes</a>.
+   */
   public FeatureGroupEntity() {
+    // Don't delete! Default constructor is required by DataStax driver
   }
 
   /**
index 7f7dab6..801a54d 100644 (file)
@@ -60,7 +60,13 @@ public class LicenseAgreementEntity implements VersionableEntity {
   @Column(name = "fg_ids")
   private Set<String> featureGroupIds = new HashSet<>();
 
+  /**
+   * Every entity class must have a default constructor according to
+   * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
+   * Definition of mapped classes</a>.
+   */
   public LicenseAgreementEntity() {
+    // Don't delete! Default constructor is required by DataStax driver
   }
 
   /**
index 7794aaf..43de02b 100644 (file)
@@ -45,7 +45,7 @@ import java.util.Set;
 @Table(keyspace = "dox", name = "license_key_group")
 public class LicenseKeyGroupEntity implements VersionableEntity {
 
-  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
   private static final String ENTITY_TYPE = "License Key Group";
 
   @PartitionKey
@@ -79,8 +79,13 @@ public class LicenseKeyGroupEntity implements VersionableEntity {
   //Defined and used only for License Artifcat XMLs
   private String manufacturerReferenceNumber;
 
-
+  /**
+   * Every entity class must have a default constructor according to
+   * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
+   * Definition of mapped classes</a>.
+   */
   public LicenseKeyGroupEntity() {
+    // Don't delete! Default constructor is required by DataStax driver
   }
 
   /**
@@ -387,11 +392,11 @@ public class LicenseKeyGroupEntity implements VersionableEntity {
   }
 
   public String getIsoFormatStartDate() {
-    mdcDataDebugMessage.debugEntryMessage("start date", startDate);
+    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("start date", startDate);
     String isoFormatStartDate = null;
     if (!StringUtils.isEmpty(startDate)) {
       isoFormatStartDate = VendorLicenseUtil.getIsoFormatDate(startDate);
-      mdcDataDebugMessage.debugExitMessage("start date", "iso format start date", startDate,
+      MDC_DATA_DEBUG_MESSAGE.debugExitMessage("start date", "iso format start date", startDate,
           isoFormatStartDate);
     }
     return isoFormatStartDate;
@@ -399,11 +404,11 @@ public class LicenseKeyGroupEntity implements VersionableEntity {
 
 
   public String getIsoFormatExpiryDate() {
-    mdcDataDebugMessage.debugEntryMessage("expiry date", expiryDate);
+    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("expiry date", expiryDate);
     String isoFormatExpDate = null;
     if (!StringUtils.isEmpty(expiryDate)) {
       isoFormatExpDate = VendorLicenseUtil.getIsoFormatDate(expiryDate);
-      mdcDataDebugMessage.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
+      MDC_DATA_DEBUG_MESSAGE.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
           isoFormatExpDate);
     }
     return isoFormatExpDate;
index 05cc78f..0d43d7e 100644 (file)
@@ -52,7 +52,13 @@ public class VendorLicenseModelEntity implements VersionableEntity {
   @Computed("writetime(vendor_name)")
   private Long writetimeMicroSeconds;
 
+  /**
+   * Every entity class must have a default constructor according to
+   * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
+   * Definition of mapped classes</a>.
+   */
   public VendorLicenseModelEntity() {
+    // Don't delete! Default constructor is required by DataStax driver
   }
 
   public VendorLicenseModelEntity(String id, Version version) {