Add impl of more PDP persistence

Add the implementation of more metods in the PDP provider.

Issue-ID: POLICY-1095
Change-Id: Ie02189cad7a262a453e1f731190525f838648401
Signed-off-by: liamfallon <liam.fallon@est.tech>
diff --git a/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java b/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java
index 9b07dfb..a0ad5c2 100644
--- a/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java
+++ b/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java
@@ -109,6 +109,9 @@
         pfDao.init(daoParameters);
 
         testAllOps();
+
+        testVersionOps();
+
         pfDao.close();
     }
 
@@ -294,4 +297,40 @@
 
         pfDao.update(new DummyReferenceEntity(new PfReferenceKey(owner5Key, "EntityF"), 120.0));
     }
+
+    private void testVersionOps() {
+        final PfConceptKey aKey0 = new PfConceptKey("AAA0", "0.0.1");
+        final PfConceptKey aKey1 = new PfConceptKey("AAA0", "0.0.2");
+        final PfConceptKey aKey2 = new PfConceptKey("AAA0", "0.0.3");
+        final PfConceptKey bKey0 = new PfConceptKey("BBB0", "0.0.1");
+        final PfConceptKey bKey1 = new PfConceptKey("BBB0", "0.0.2");
+        final PfConceptKey bKey2 = new PfConceptKey("BBB0", "0.0.3");
+        final DummyConceptEntity keyInfo0 = new DummyConceptEntity(aKey0,
+                UUID.fromString("00000000-0000-0000-0000-000000000000"), "key description 0");
+        final DummyConceptEntity keyInfo1 = new DummyConceptEntity(aKey1,
+                UUID.fromString("00000000-0000-0000-0000-000000000001"), "key description 1");
+        final DummyConceptEntity keyInfo2 = new DummyConceptEntity(aKey2,
+                UUID.fromString("00000000-0000-0000-0000-000000000002"), "key description 2");
+        final DummyConceptEntity keyInfo3 = new DummyConceptEntity(bKey0,
+                UUID.fromString("00000000-0000-0000-0000-000000000000"), "key description 0");
+        final DummyConceptEntity keyInfo4 = new DummyConceptEntity(bKey1,
+                UUID.fromString("00000000-0000-0000-0000-000000000001"), "key description 1");
+        final DummyConceptEntity keyInfo5 = new DummyConceptEntity(bKey2,
+                UUID.fromString("00000000-0000-0000-0000-000000000002"), "key description 2");
+
+        pfDao.create(keyInfo0);
+        pfDao.create(keyInfo1);
+        pfDao.create(keyInfo2);
+        pfDao.create(keyInfo3);
+        pfDao.create(keyInfo4);
+        pfDao.create(keyInfo5);
+
+        assertEquals(3, pfDao.getAllVersions(DummyConceptEntity.class, "AAA0").size());
+        DummyConceptEntity latestVersionEntity = pfDao.getLatestVersion(DummyConceptEntity.class, "AAA0");
+        assertEquals(aKey2, latestVersionEntity.getKey());
+        List<DummyConceptEntity> returnedLatestVersions = pfDao.getLatestVersions(DummyConceptEntity.class);
+        assertEquals(2, returnedLatestVersions.size());
+        assertEquals("0.0.3", returnedLatestVersions.get(0).getKey().getVersion());
+        assertEquals("0.0.3", returnedLatestVersions.get(1).getKey().getVersion());
+    }
 }
diff --git a/models-dao/src/test/resources/META-INF/persistence.xml b/models-dao/src/test/resources/META-INF/persistence.xml
index 5779deb..25858ca 100644
--- a/models-dao/src/test/resources/META-INF/persistence.xml
+++ b/models-dao/src/test/resources/META-INF/persistence.xml
@@ -37,6 +37,18 @@
             <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
             <property name="eclipselink.ddl-generation.output-mode" value="database" />
             <property name="eclipselink.logging.level" value="INFO" />
+            
+            <property name="eclipselink.logging.level" value="ALL" />
+            <property name="eclipselink.logging.level.jpa" value="ALL" />
+            <property name="eclipselink.logging.level.ddl" value="ALL" />
+            <property name="eclipselink.logging.level.connection" value="ALL" />
+            <property name="eclipselink.logging.level.sql" value="ALL" />
+            <property name="eclipselink.logging.level.transaction" value="ALL" />
+            <property name="eclipselink.logging.level.sequencing" value="ALL" />
+            <property name="eclipselink.logging.level.server" value="ALL" />
+            <property name="eclipselink.logging.level.query" value="ALL" />
+            <property name="eclipselink.logging.level.properties" value="ALL" />
+            
         </properties>
     </persistence-unit>
 </persistence>