diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/PfDao.java b/models-dao/src/main/java/org/onap/policy/models/dao/PfDao.java
index 85c971c..609afef 100644
--- a/models-dao/src/main/java/org/onap/policy/models/dao/PfDao.java
+++ b/models-dao/src/main/java/org/onap/policy/models/dao/PfDao.java
@@ -29,8 +29,8 @@
 import org.onap.policy.models.base.PfReferenceKey;
 
 /**
- * The Interface PfDao describes the DAO interface for reading and writing Policy Framework
- * {@link PfConcept} concepts to and from databases using JDBC.
+ * The Interface PfDao describes the DAO interface for reading and writing Policy Framework {@link PfConcept} concepts
+ * to and from databases using JDBC.
  */
 public interface PfDao {
 
@@ -108,7 +108,7 @@
     <T extends PfConcept> int deleteByConceptKey(Class<T> someClass, Collection<PfConceptKey> keys);
 
     /**
-     * Delete a collection of objects in the database referred to by reference key.
+     * policypolicypolicy Delete a collection of objects in the database referred to by reference key.
      *
      * @param <T> the type of the objects to delete, a subclass of {@link PfConcept}
      * @param someClass the class of the objects to delete, a subclass of {@link PfConcept}
@@ -129,6 +129,18 @@
      * Get an object from the database, referred to by concept key.
      *
      * @param <T> the type of the object to get, a subclass of {@link PfConcept}
+     * @param someClass the class of the object to get, a subclass of {@link PfConcept}, if name is null, all concepts
+     *        of type T are returned, if name is not null and version is null, all versions of that concept matching the
+     *        name are returned.
+     * @param key the key of the object to get
+     * @return the objects that was retrieved from the database
+     */
+    <T extends PfConcept> List<T> getFiltered(Class<T> someClass, PfConceptKey key);
+
+    /**
+     * Get an object from the database, referred to by concept key.
+     *
+     * @param <T> the type of the object to get, a subclass of {@link PfConcept}
      * @param someClass the class of the object to get, a subclass of {@link PfConcept}
      * @param key the key of the object to get
      * @return the object that was retrieved from the database
@@ -141,8 +153,7 @@
      * @param <T> the type of the object to get, a subclass of {@link PfConcept}
      * @param someClass the class of the object to get, a subclass of {@link PfConcept}
      * @param key the key of the object to get
-     * @return the object that was retrieved from the database or null if the object was not
-     *         retrieved
+     * @return the object that was retrieved from the database or null if the object was not retrieved
      */
     <T extends PfConcept> T get(Class<T> someClass, PfReferenceKey key);
 
@@ -166,6 +177,35 @@
     <T extends PfConcept> List<T> getAll(Class<T> someClass, PfConceptKey parentKey);
 
     /**
+     * Get all the objects in the database of a given type.
+     *
+     * @param <T> the type of the objects to get, a subclass of {@link PfConcept}
+     * @param someClass the class of the objects to get, a subclass of {@link PfConcept}
+     * @param name the name of the concepts for which to get all versions
+     * @return the objects or null if no objects were retrieved
+     */
+    <T extends PfConcept> List<T> getAllVersions(Class<T> someClass, final String name);
+
+    /**
+     * Get latest version of objects in the database of a given type.
+     *
+     * @param <T> the type of the objects to get, a subclass of {@link PfConcept}
+     * @param someClass the class of the objects to get, a subclass of {@link PfConcept}
+     * @return the objects or null if no objects were retrieved
+     */
+    <T extends PfConcept> List<T> getLatestVersions(Class<T> someClass);
+
+    /**
+     * Get latest version of an object in the database of a given type.
+     *
+     * @param <T> the type of the objects to get, a subclass of {@link PfConcept}
+     * @param someClass the class of the objects to get, a subclass of {@link PfConcept}
+     * @param conceptName the name of the concept for which to get the latest version
+     * @return the objects or null if no objects were retrieved
+     */
+    <T extends PfConcept> T getLatestVersion(Class<T> someClass, final String conceptName);
+
+    /**
      * Get a concept from the database with the given concept key.
      *
      * @param <T> the type of the object to get, a subclass of {@link PfConcept}
@@ -197,7 +237,7 @@
     /**
      * Update a concept in the database.
      *
-     * @param <T> the type of the object to get, a subclass of {@link PfConcept}
+     * @param <T> the type of the object to update, a subclass of {@link PfConcept}
      * @param obj the object to update
      * @return the updated object
      */
diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java
index 947b866..f7659b2 100644
--- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java
+++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java
@@ -40,20 +40,58 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The Class DefaultPfDao is an JPA implementation of the {@link PfDao} class for Policy Framework
- * concepts ({@link PfConcept}). It uses the default JPA implementation in the javax
- * {@link Persistence} class.
+ * The Class DefaultPfDao is an JPA implementation of the {@link PfDao} class for Policy Framework concepts
+ * ({@link PfConcept}). It uses the default JPA implementation in the javax {@link Persistence} class.
  */
 public class DefaultPfDao implements PfDao {
     private static final Logger LOGGER = LoggerFactory.getLogger(DefaultPfDao.class);
 
-    private static final String SELECT_C_FROM = "SELECT c FROM ";
-    private static final String AND_C_KEY_LOCAL_NAME = "' AND c.key.localName='";
-    private static final String AND_C_KEY_PARENT_KEY_VERSION = "' AND c.key.parentKeyVersion='";
-    private static final String C_WHERE_C_KEY_PARENT_KEY_NAME = " c WHERE c.key.parentKeyName='";
-    private static final String AND_C_KEY_VERSION = "' AND c.key.version='";
-    private static final String C_WHERE_C_KEY_NAME = " c WHERE c.key.name='";
-    private static final String DELETE_FROM = "DELETE FROM ";
+    // @formatter:off
+    private static final String NAME           = "name";
+    private static final String VERSION        = "version";
+    private static final String PARENT_NAME    = "parentname";
+    private static final String PARENT_VERSION = "parentversion";
+    private static final String LOCAL_NAME     = "localname";
+
+    private static final String TABLE_TOKEN = "__TABLE__";
+
+    private static final String DELETE_FROM_TABLE = "DELETE FROM __TABLE__ c";
+
+    private static final String SELECT_FROM_TABLE = "SELECT c FROM __TABLE__ c";
+
+    private static final String WHERE      = " WHERE ";
+    private static final String AND        = " AND ";
+
+    private static final String NAME_FILTER           = "c.key.name = :name";
+    private static final String VERSION_FILTER        = "c.key.version = :version";
+    private static final String PARENT_NAME_FILTER    = "c.key.parentKeyName = :parentname";
+    private static final String PARENT_VERSION_FILTER = "c.key.parentKeyVersion = :parentversion";
+    private static final String LOCAL_NAME_FILTER     = "c.key.localName = :localname";
+    private static final String MAX_VERISON_FILTER    = "c.key.version = (SELECT MAX(c.key.version) FROM __TABLE__ c)";
+
+    private static final String DELETE_BY_CONCEPT_KEY =
+            DELETE_FROM_TABLE + WHERE + NAME_FILTER + AND + VERSION_FILTER;
+
+    private static final String DELETE_BY_REFERENCE_KEY =
+            DELETE_FROM_TABLE + WHERE + PARENT_NAME_FILTER + AND + PARENT_VERSION_FILTER + AND + LOCAL_NAME_FILTER;
+
+    private static final String SELECT_ALL_FOR_PARENT =
+            SELECT_FROM_TABLE + WHERE + PARENT_NAME_FILTER + AND + PARENT_VERSION_FILTER;
+
+    private static final String SELECT_ALL_VERSIONS = SELECT_FROM_TABLE + WHERE + NAME_FILTER;
+
+    private static final String SELECT_LATEST_VERSION =
+            SELECT_FROM_TABLE + WHERE + NAME_FILTER + AND + MAX_VERISON_FILTER;
+
+    private static final String SELECT_LATEST_VERSIONS =
+            "SELECT c FROM __TABLE__ c WHERE c.key.version = (SELECT MAX(c.key.version) FROM __TABLE__ c)";
+
+    private static final String SELECT_BY_CONCEPT_KEY =
+            SELECT_FROM_TABLE + WHERE + NAME_FILTER + AND + VERSION_FILTER;
+
+    private static final String SELECT_BY_REFERENCE_KEY =
+            SELECT_FROM_TABLE + WHERE + PARENT_NAME_FILTER + AND + PARENT_VERSION_FILTER + AND + LOCAL_NAME_FILTER;
+    // @formatter:on
 
     // Entity manager for JPA
     private EntityManagerFactory emf = null;
@@ -138,10 +176,14 @@
         }
         final EntityManager mg = getEntityManager();
         try {
+            // @formatter:off
             mg.getTransaction().begin();
-            mg.createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
-                    + AND_C_KEY_VERSION + key.getVersion() + "'", someClass).executeUpdate();
+            mg.createQuery(setQueryTable(DELETE_BY_CONCEPT_KEY, someClass), someClass)
+                .setParameter(NAME,    key.getName())
+                .setParameter("version", key.getVersion())
+                .executeUpdate();
             mg.getTransaction().commit();
+            // @formatter:on
         } finally {
             mg.close();
         }
@@ -154,11 +196,15 @@
         }
         final EntityManager mg = getEntityManager();
         try {
+            // @formatter:off
             mg.getTransaction().begin();
-            mg.createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
-                    + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
-                    + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).executeUpdate();
+            mg.createQuery(setQueryTable(DELETE_BY_REFERENCE_KEY, someClass), someClass)
+                .setParameter(PARENT_NAME,    key.getParentKeyName())
+                .setParameter(PARENT_VERSION, key.getParentKeyVersion())
+                .setParameter(LOCAL_NAME,     key.getLocalName())
+                .executeUpdate();
             mg.getTransaction().commit();
+            // @formatter:on
         } finally {
             mg.close();
         }
@@ -206,12 +252,16 @@
         int deletedCount = 0;
         final EntityManager mg = getEntityManager();
         try {
+            // @formatter:off
             mg.getTransaction().begin();
             for (final PfConceptKey key : keys) {
-                deletedCount += mg.createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME
-                        + key.getName() + AND_C_KEY_VERSION + key.getVersion() + "'", someClass).executeUpdate();
+                deletedCount += mg.createQuery(setQueryTable(DELETE_BY_CONCEPT_KEY, someClass), someClass)
+                    .setParameter(NAME,    key.getName())
+                    .setParameter("version", key.getVersion())
+                    .executeUpdate();
             }
             mg.getTransaction().commit();
+            // @formatter:on
         } finally {
             mg.close();
         }
@@ -227,16 +277,17 @@
         int deletedCount = 0;
         final EntityManager mg = getEntityManager();
         try {
+            // @formatter:off
             mg.getTransaction().begin();
             for (final PfReferenceKey key : keys) {
-                deletedCount +=
-                        mg.createQuery(
-                                DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
-                                        + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION
-                                        + key.getParentKeyVersion() + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'",
-                                someClass).executeUpdate();
+                deletedCount += mg.createQuery(setQueryTable(DELETE_BY_REFERENCE_KEY, someClass), someClass)
+                    .setParameter(PARENT_NAME,    key.getParentKeyName())
+                    .setParameter(PARENT_VERSION, key.getParentKeyVersion())
+                    .setParameter(LOCAL_NAME,     key.getLocalName())
+                    .executeUpdate();
             }
             mg.getTransaction().commit();
+            // @formatter:on
         } finally {
             mg.close();
         }
@@ -248,7 +299,7 @@
         final EntityManager mg = getEntityManager();
         try {
             mg.getTransaction().begin();
-            mg.createQuery(DELETE_FROM + someClass.getSimpleName() + " c ", someClass).executeUpdate();
+            mg.createQuery(setQueryTable(DELETE_FROM_TABLE, someClass), someClass).executeUpdate();
             mg.getTransaction().commit();
         } finally {
             mg.close();
@@ -256,6 +307,21 @@
     }
 
     @Override
+    public <T extends PfConcept> List<T> getFiltered(Class<T> someClass, PfConceptKey key) {
+        if (key.getName() == null) {
+            return getAll(someClass);
+        }
+
+        if (key.getVersion() == null) {
+            return getAllVersions(someClass, key.getName());
+        }
+
+        T foundConcept = get(someClass, key);
+
+        return (foundConcept == null ? Collections.emptyList() : Collections.singletonList(foundConcept));
+    }
+
+    @Override
     public <T extends PfConcept> T get(final Class<T> someClass, final PfConceptKey key) {
         if (someClass == null) {
             return null;
@@ -313,7 +379,7 @@
         }
         final EntityManager mg = getEntityManager();
         try {
-            return mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + " c", someClass).getResultList();
+            return mg.createQuery(setQueryTable(SELECT_FROM_TABLE, someClass), someClass).getResultList();
         } finally {
             mg.close();
         }
@@ -326,18 +392,72 @@
         }
         final EntityManager mg = getEntityManager();
         try {
-            return mg
-                    .createQuery(
-                            SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
-                                    + parentKey.getName() + AND_C_KEY_PARENT_KEY_VERSION + parentKey.getVersion() + "'",
-                            someClass)
+            // @formatter:off
+            return mg.createQuery(setQueryTable(SELECT_ALL_FOR_PARENT, someClass), someClass)
+                    .setParameter(PARENT_NAME,    parentKey.getName())
+                    .setParameter(PARENT_VERSION, parentKey.getVersion())
                     .getResultList();
+            // @formatter:on
         } finally {
             mg.close();
         }
     }
 
     @Override
+    public <T extends PfConcept> List<T> getAllVersions(final Class<T> someClass, final String conceptName) {
+        if (someClass == null || conceptName == null) {
+            return Collections.emptyList();
+        }
+        final EntityManager mg = getEntityManager();
+        try {
+            // @formatter:off
+            return mg.createQuery(setQueryTable(SELECT_ALL_VERSIONS, someClass), someClass)
+                    .setParameter(NAME, conceptName)
+                    .getResultList();
+            // @formatter:on
+        } finally {
+            mg.close();
+        }
+    }
+
+    @Override
+    public <T extends PfConcept> List<T> getLatestVersions(final Class<T> someClass) {
+        if (someClass == null) {
+            return Collections.emptyList();
+        }
+        final EntityManager mg = getEntityManager();
+        List<T> ret;
+        try {
+            // @formatter:off
+            return mg.createQuery(setQueryTable(SELECT_LATEST_VERSIONS, someClass), someClass)
+                    .getResultList();
+            // @formatter:on
+        } finally {
+            mg.close();
+        }
+    }
+
+    @Override
+    public <T extends PfConcept> T getLatestVersion(final Class<T> someClass, final String conceptName) {
+        if (someClass == null || conceptName == null) {
+            return null;
+        }
+        final EntityManager mg = getEntityManager();
+        List<T> ret;
+        try {
+            // @formatter:off
+            ret = mg.createQuery(setQueryTable(SELECT_LATEST_VERSION, someClass), someClass)
+                    .setParameter(NAME, conceptName)
+                    .getResultList();
+            // @formatter:on
+        } finally {
+            mg.close();
+        }
+
+        return getSingleResult(someClass, conceptName, ret);
+    }
+
+    @Override
     public <T extends PfConcept> T getConcept(final Class<T> someClass, final PfConceptKey key) {
         if (someClass == null || key == null) {
             return null;
@@ -345,19 +465,17 @@
         final EntityManager mg = getEntityManager();
         List<T> ret;
         try {
-            ret = mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
-                    + AND_C_KEY_VERSION + key.getVersion() + "'", someClass).getResultList();
+            // @formatter:off
+            ret = mg.createQuery(setQueryTable(SELECT_BY_CONCEPT_KEY, someClass), someClass)
+                    .setParameter(NAME,    key.getName())
+                    .setParameter(VERSION, key.getVersion())
+                    .getResultList();
+            // @formatter:on
         } finally {
             mg.close();
         }
-        if (ret == null || ret.isEmpty()) {
-            return null;
-        }
-        if (ret.size() > 1) {
-            throw new IllegalArgumentException("More than one result was returned for search for " + someClass
-                    + " with key " + key.getId() + ": " + ret);
-        }
-        return ret.get(0);
+
+        return getSingleResult(someClass, key.getId(), ret);
     }
 
     @Override
@@ -368,20 +486,18 @@
         final EntityManager mg = getEntityManager();
         List<T> ret;
         try {
-            ret = mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
-                    + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
-                    + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).getResultList();
+            // @formatter:off
+            ret = mg.createQuery(setQueryTable(SELECT_BY_REFERENCE_KEY, someClass), someClass)
+                    .setParameter(PARENT_NAME,    key.getParentKeyName())
+                    .setParameter(PARENT_VERSION, key.getParentKeyVersion())
+                    .setParameter(LOCAL_NAME,     key.getLocalName())
+                    .getResultList();
+            // @formatter:on
         } finally {
             mg.close();
         }
-        if (ret == null || ret.isEmpty()) {
-            return null;
-        }
-        if (ret.size() > 1) {
-            throw new IllegalArgumentException("More than one result was returned for search for " + someClass
-                    + " with key " + key.getId() + ": " + ret);
-        }
-        return ret.get(0);
+
+        return getSingleResult(someClass, key.getId(), ret);
     }
 
     @Override
@@ -414,4 +530,34 @@
         }
         return size;
     }
+
+    /**
+     * Add the table to a query string.
+     *
+     * @param queryString the query string
+     * @param tableClass the class name of the table
+     * @return the updated query string
+     */
+    private <T extends PfConcept> String setQueryTable(final String queryString, final Class<T> tableClass) {
+        return queryString.replaceAll(TABLE_TOKEN, tableClass.getSimpleName());
+    }
+
+    /**
+     * Check that a query returned one and only one entry and return that entry.
+     *
+     * @param someClass the class being searched for
+     * @param conceptName the concept name being searched for
+     * @param resultList the result list returned by the query
+     * @return the single unique result
+     */
+    private <T extends PfConcept> T getSingleResult(final Class<T> someClass, final String searchFilter, List<T> ret) {
+        if (ret == null || ret.isEmpty()) {
+            return null;
+        }
+        if (ret.size() > 1) {
+            throw new IllegalArgumentException("More than one result was returned query on " + someClass
+                    + " with filter " + searchFilter + ": " + ret);
+        }
+        return ret.get(0);
+    }
 }
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>
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java
index a32f5a4..20553d7 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java
@@ -21,7 +21,6 @@
 package org.onap.policy.models.pdp.persistence.provider;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -34,12 +33,16 @@
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.base.PfReferenceKey;
 import org.onap.policy.models.base.PfValidationResult;
 import org.onap.policy.models.dao.PfDao;
+import org.onap.policy.models.pdp.concepts.Pdp;
 import org.onap.policy.models.pdp.concepts.PdpGroup;
 import org.onap.policy.models.pdp.concepts.PdpStatistics;
 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
+import org.onap.policy.models.pdp.persistence.concepts.JpaPdp;
 import org.onap.policy.models.pdp.persistence.concepts.JpaPdpGroup;
+import org.onap.policy.models.pdp.persistence.concepts.JpaPdpSubGroup;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,11 +55,14 @@
 public class PdpProvider {
     private static final Logger LOGGER = LoggerFactory.getLogger(PdpProvider.class);
 
+    // Recurring string constants
+    private static final String NOT_VALID = "\" is not valid \n";
+
     /**
      * Get PDP groups.
      *
      * @param dao the DAO to use to access the database
-     * @param name the name of the policy to get, null to get all PDP groups
+     * @param name the name of the PDP group to get, null to get all PDP groups
      * @param version the version of the policy to get, null to get all versions of a PDP group
      * @return the PDP groups found
      * @throws PfModelException on errors getting PDP groups
@@ -64,20 +70,19 @@
     public List<PdpGroup> getPdpGroups(@NonNull final PfDao dao, final String name, final String version)
             throws PfModelException {
 
-        PfConceptKey jpaPdpGroupKey = new PfConceptKey(name, version);
-        JpaPdpGroup jpaPdpGroup = dao.get(JpaPdpGroup.class, jpaPdpGroupKey);
+        List<JpaPdpGroup> foundPdpGroups = dao.getFiltered(JpaPdpGroup.class, new PfConceptKey(name, version));
 
-        if (jpaPdpGroup != null) {
-            return Collections.singletonList(jpaPdpGroup.toAuthorative());
+        if (foundPdpGroups != null) {
+            return asPdpGroupList(foundPdpGroups);
         } else {
-            String errorMessage = "PDP group not found: " + jpaPdpGroupKey.getId();
+            String errorMessage = "no PDP groups found for filter " + name + ":" + version;
             LOGGER.warn(errorMessage);
             throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
         }
     }
 
     /**
-     * Get latest PDP Groups.
+     * Get latest PDP Groups, returns PDP groups in all states.
      *
      * @param dao the DAO to use to access the database
      * @param name the name of the PDP group to get, null to get all PDP groups
@@ -85,11 +90,20 @@
      * @throws PfModelException on errors getting policies
      */
     public List<PdpGroup> getLatestPdpGroups(@NonNull final PfDao dao, final String name) throws PfModelException {
-        return new ArrayList<>();
+        List<JpaPdpGroup> returnList = new ArrayList<>();
+
+        if (name == null) {
+            returnList.add(dao.getLatestVersion(JpaPdpGroup.class, name));
+        }
+        else {
+            returnList.addAll(dao.getLatestVersions(JpaPdpGroup.class));
+        }
+
+        return asPdpGroupList(returnList);
     }
 
     /**
-     * Get a filtered list of PDP groups.
+     * Get a filtered list of PDP groups, returns only active PDP groups.
      *
      * @param dao the DAO to use to access the database
      * @param pdpType The PDP type filter for the returned PDP groups, null to get policy types across PDP subgroups
@@ -118,7 +132,7 @@
 
             PfValidationResult validationResult = jpaPdpGroup.validate(new PfValidationResult());
             if (!validationResult.isOk()) {
-                String errorMessage = "pdp group \"" + jpaPdpGroup.getId() + "\" is not valid \n" + validationResult;
+                String errorMessage = "pdp group \"" + jpaPdpGroup.getId() + NOT_VALID + validationResult;
                 LOGGER.warn(errorMessage);
                 throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
             }
@@ -148,9 +162,32 @@
      */
     public List<PdpGroup> updatePdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups)
             throws PfModelException {
-        return new ArrayList<>();
-    }
 
+        for (PdpGroup pdpGroup : pdpGroups) {
+            JpaPdpGroup jpaPdpGroup = new JpaPdpGroup();;
+            jpaPdpGroup.fromAuthorative(pdpGroup);
+
+            PfValidationResult validationResult = jpaPdpGroup.validate(new PfValidationResult());
+            if (!validationResult.isOk()) {
+                String errorMessage = "pdp group \"" + jpaPdpGroup.getId() + NOT_VALID + validationResult;
+                LOGGER.warn(errorMessage);
+                throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            }
+
+            dao.update(jpaPdpGroup);
+        }
+
+        // Return the created PDP groups
+        List<PdpGroup> returnPdpGroups = new ArrayList<>();
+
+        for (PdpGroup pdpGroup : pdpGroups) {
+            JpaPdpGroup jpaPdpGroup =
+                    dao.get(JpaPdpGroup.class, new PfConceptKey(pdpGroup.getName(), pdpGroup.getVersion()));
+            returnPdpGroups.add(jpaPdpGroup.toAuthorative());
+        }
+
+        return returnPdpGroups;
+    }
 
     /**
      * Update a PDP subgroup.
@@ -163,7 +200,54 @@
      */
     public void updatePdpSubGroup(@NonNull final PfDao dao, @NonNull final String pdpGroupName,
             @NonNull final String pdpGroupVersion, @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException {
-        // Not implemented yet
+
+        final PfReferenceKey subGroupKey = new PfReferenceKey(pdpGroupName, pdpGroupVersion, pdpSubGroup.getPdpType());
+        final JpaPdpSubGroup jpaPdpSubgroup = new JpaPdpSubGroup(subGroupKey);
+        jpaPdpSubgroup.fromAuthorative(pdpSubGroup);
+
+        PfValidationResult validationResult = jpaPdpSubgroup.validate(new PfValidationResult());
+        if (!validationResult.isOk()) {
+            String errorMessage = "PDP subgroup \"" + jpaPdpSubgroup.getId() + NOT_VALID + validationResult;
+            LOGGER.warn(errorMessage);
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+        }
+
+        if (dao.update(jpaPdpSubgroup) == null) {
+            String errorMessage = "update of PDP subgroup \"" + jpaPdpSubgroup.getId() + "\" failed";
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+        }
+    }
+
+    /**
+     * Update a PDP.
+     *
+     * @param dao the DAO to use to access the database
+     * @param pdpGroupName the name of the PDP group of the PDP subgroup
+     * @param pdpGroupVersion the version of the PDP group of the PDP subgroup
+     * @param pdpSubGroup the PDP subgroup to be updated
+     * @param pdp the PDP to be updated
+     * @throws PfModelException on errors updating PDP subgroups
+     */
+    public void updatePdp(@NonNull final PfDao dao, @NonNull final String pdpGroupName,
+            @NonNull final String pdpGroupVersion, @NonNull final String pdpSubGroup, @NonNull final Pdp pdp)
+            throws PfModelException {
+
+        final PfReferenceKey pdpKey =
+                new PfReferenceKey(pdpGroupName, pdpGroupVersion, pdpSubGroup, pdp.getInstanceId());
+        final JpaPdp jpaPdp = new JpaPdp(pdpKey);
+        jpaPdp.fromAuthorative(pdp);
+
+        PfValidationResult validationResult = jpaPdp.validate(new PfValidationResult());
+        if (!validationResult.isOk()) {
+            String errorMessage = "PDP \"" + jpaPdp.getId() + NOT_VALID + validationResult;
+            LOGGER.warn(errorMessage);
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+        }
+
+        if (dao.update(jpaPdp) == null) {
+            String errorMessage = "update of PDP \"" + jpaPdp.getId() + "\" failed";
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+        }
     }
 
     /**
@@ -177,8 +261,20 @@
      */
     public PdpGroup deletePdpGroup(@NonNull final PfDao dao, @NonNull final String name, @NonNull final String version)
             throws PfModelException {
-        return new PdpGroup();
 
+        PfConceptKey pdpGroupKey = new PfConceptKey(name, version);
+
+        JpaPdpGroup jpaDeletePdpGroup = dao.get(JpaPdpGroup.class, pdpGroupKey);
+
+        if (jpaDeletePdpGroup == null) {
+            String errorMessage =
+                    "delete of PDP group \"" + pdpGroupKey.getId() + "\" failed, PDP group does not exist";
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+        }
+
+        dao.delete(jpaDeletePdpGroup);
+
+        return jpaDeletePdpGroup.toAuthorative();
     }
 
     /**
@@ -223,4 +319,20 @@
             final String name) throws PfModelException {
         return new LinkedHashMap<>();
     }
+
+    /**
+     * Convert JPA PDP group list to an authorative PDP group list.
+     *
+     * @param foundPdpGroups the list to convert
+     * @return the authorative list
+     */
+    private List<PdpGroup> asPdpGroupList(List<JpaPdpGroup> jpaPdpGroupList) {
+        List<PdpGroup> pdpGroupList = new ArrayList<>(jpaPdpGroupList.size());
+
+        for (JpaPdpGroup jpaPdpGroup : jpaPdpGroupList) {
+            pdpGroupList.add(jpaPdpGroup.toAuthorative());
+        }
+
+        return pdpGroupList;
+    }
 }
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
index af1c88f..12c72d7 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
@@ -27,6 +27,7 @@
 
 import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.pdp.concepts.Pdp;
 import org.onap.policy.models.pdp.concepts.PdpGroup;
 import org.onap.policy.models.pdp.concepts.PdpStatistics;
 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
@@ -152,6 +153,18 @@
      * @return the policies found
      * @throws PfModelException on errors getting policies
      */
+    public ToscaServiceTemplate getPolicies4PolicyType(@NonNull final String policyTypeName,
+            final String policyTypeVersion) throws PfModelException;
+
+    /**
+     * Get policies for a policy type name.
+     *
+     * @param policyTypeName the name of the policy type for which to get policies
+     * @param policyTypeVersion the version of the policy type, null returns all versions of deployed policies for
+     *        policy types
+     * @return the policies found
+     * @throws PfModelException on errors getting policies
+     */
     public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull final String policyTypeName,
             final String policyTypeVersion) throws PfModelException;
 
@@ -328,7 +341,6 @@
      */
     public List<PdpGroup> updatePdpGroups(@NonNull final List<PdpGroup> pdpGroups) throws PfModelException;
 
-
     /**
      * Update a PDP subgroup.
      *
@@ -341,6 +353,18 @@
             @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException;
 
     /**
+     * Update a PDP.
+     *
+     * @param pdpGroupName the name of the PDP group of the PDP subgroup
+     * @param pdpGroupVersion the version of the PDP group of the PDP subgroup
+     * @param pdpSubGroup the PDP subgroup to be updated
+     * @param pdp the PDP to be updated
+     * @throws PfModelException on errors updating PDP subgroups
+     */
+    public void updatePdp(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion,
+            @NonNull final String pdpSubGroup, @NonNull final Pdp pdp) throws PfModelException;
+
+    /**
      * Delete a PDP group.
      *
      * @param name the name of the policy to get, null to get all PDP groups
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
index 96185b6..51b7d2f 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
@@ -37,6 +37,7 @@
 import org.onap.policy.models.dao.PfDao;
 import org.onap.policy.models.dao.PfDaoFactory;
 import org.onap.policy.models.dao.impl.DefaultPfDao;
+import org.onap.policy.models.pdp.concepts.Pdp;
 import org.onap.policy.models.pdp.concepts.PdpGroup;
 import org.onap.policy.models.pdp.concepts.PdpStatistics;
 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
@@ -206,6 +207,13 @@
     }
 
     @Override
+    public ToscaServiceTemplate getPolicies4PolicyType(@NonNull String policyTypeName, String policyTypeVersion)
+            throws PfModelException {
+        assertInitilized();
+        return new AuthorativeToscaProvider().getPolicies4PolicyType(pfDao, policyTypeName, policyTypeVersion);
+    }
+
+    @Override
     public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull final String policyTypeName,
             final String policyTypeVersion) throws PfModelException {
         assertInitilized();
@@ -337,6 +345,12 @@
     }
 
     @Override
+    public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpGroupVersion,
+            @NonNull String pdpSubGroup, @NonNull Pdp pdp) throws PfModelException {
+        new PdpProvider().updatePdp(pfDao, pdpGroupName, pdpGroupVersion, pdpSubGroup, pdp);
+    }
+
+    @Override
     public PdpGroup deletePdpGroup(@NonNull final String name, @NonNull final String version) throws PfModelException {
         assertInitilized();
         return new PdpProvider().deletePdpGroup(pfDao, name, version);
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
index bf707ef..52929ab 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
@@ -34,6 +34,7 @@
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.pdp.concepts.Pdp;
 import org.onap.policy.models.pdp.concepts.PdpGroup;
 import org.onap.policy.models.pdp.concepts.PdpStatistics;
 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
@@ -119,6 +120,12 @@
     }
 
     @Override
+    public ToscaServiceTemplate getPolicies4PolicyType(@NonNull String policyTypeName, String policyTypeVersion)
+            throws PfModelException {
+        return null;
+    }
+
+    @Override
     public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull final String policyTypeName,
             final String policyTypeVersion) throws PfModelException {
         return new ArrayList<>();
@@ -231,6 +238,12 @@
     }
 
     @Override
+    public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpGroupVersion,
+            @NonNull String pdpSubGroup, @NonNull Pdp pdp) throws PfModelException {
+        // Not implemented
+    }
+
+    @Override
     public PdpGroup deletePdpGroup(@NonNull final String name, @NonNull final String version) throws PfModelException {
         return null;
     }
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
index 7ad2217..8a83f44 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
@@ -21,6 +21,7 @@
 package org.onap.policy.models.provider.impl;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
@@ -311,13 +312,14 @@
                 databaseProvider.deleteGuardPolicy("policy_id");
             }).hasMessage("no policy found for policy ID: policy_id");
 
-            assertThatThrownBy(() -> {
-                databaseProvider.getPdpGroups("name", "version");
-            }).hasMessage("PDP group not found: name:version");
+            assertEquals(0, databaseProvider.getPdpGroups("name", "version").size());
 
             assertNotNull(databaseProvider.createPdpGroups(new ArrayList<>()));
             assertNotNull(databaseProvider.updatePdpGroups(new ArrayList<>()));
-            assertNotNull(databaseProvider.deletePdpGroup("name", "version"));
+
+            assertThatThrownBy(() -> {
+                databaseProvider.deletePdpGroup("name", "version");
+            }).hasMessage("delete of PDP group \"name:version\" failed, PDP group does not exist");
 
         } catch (Exception exc) {
             LOGGER.warn("test should not throw an exception", exc);
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
index c64603d..69b7a0f 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
@@ -30,6 +30,7 @@
 import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.pdp.concepts.Pdp;
 import org.onap.policy.models.pdp.concepts.PdpGroup;
 import org.onap.policy.models.pdp.concepts.PdpStatistics;
 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
@@ -159,6 +160,11 @@
     }
 
     @Override
+    public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpGroupVersion,
+            @NonNull String pdpSubGroup, @NonNull Pdp pdp) throws PfModelException {
+    }
+
+    @Override
     public PdpGroup deletePdpGroup(@NonNull String name, @NonNull String verison) throws PfModelException {
         return null;
     }
@@ -184,6 +190,12 @@
     }
 
     @Override
+    public ToscaServiceTemplate getPolicies4PolicyType(@NonNull String policyTypeName, String policyTypeVersion)
+            throws PfModelException {
+        return null;
+    }
+
+    @Override
     public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull String policyTypeName, final String policyTypeVersion)
             throws PfModelException {
         return null;
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java
index d0127d6..2b6c25e 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java
@@ -179,6 +179,21 @@
      * @return the policies found
      * @throws PfModelException on errors getting policies
      */
+    public ToscaServiceTemplate getPolicies4PolicyType(@NonNull final PfDao dao, @NonNull final String policyTypeName,
+            final String policyTypeVersion) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Get policies for a policy type name.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyTypeName the name of the policy type for which to get policies
+     * @param policyTypeVersion the version of the policy type, null returns all versions of deployed policies for
+     *        policy types
+     * @return the policies found
+     * @throws PfModelException on errors getting policies
+     */
     public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull final PfDao dao, @NonNull final String policyTypeName,
             final String policyTypeVersion) throws PfModelException {
         return new ArrayList<>();
