pool-name: bpmn-pool
             registerMbeans: true
          nfvo:
-            jdbcUrl: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn
-            username: ${DB_USERNAME}
-            password: ${DB_PASSWORD}
+            jdbcUrl: jdbc:mariadb://${DB_HOST}:${DB_PORT}/nfvo
+            username: ${NFVO_USERNAME}
+            password: ${NFVO_PASSWORD}
             driver-class-name: org.mariadb.jdbc.Driver
             pool-name: nfvo-pool
             registerMbeans: true
 
     public void setCreateNsResponse(final DelegateExecution execution) {
         logger.info("Executing setCreateNsResponse  ...");
         final String nsInstId = (String) execution.getVariable(NS_INSTANCE_ID_PARAM_NAME);
-        final Optional<NfvoNsInst> optional = databaseServiceProvider.getNfvoNsInstByNsInstId(nsInstId);
+        final Optional<NfvoNsInst> optional = databaseServiceProvider.getNfvoNsInst(nsInstId);
 
         if (optional.isPresent()) {
             final NfvoNsInst nfvoNsInst = optional.get();
 
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2020 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.etsi.nfvo.ns.lcm.database.repository;
+
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpOcc;
+import org.springframework.data.repository.CrudRepository;
+import java.util.Optional;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ * @author mukeshsharma(mukeshsharma@est.tech)
+ */
+public interface NSLcmOpOccRepository extends CrudRepository<NsLcmOpOcc, String> {
+
+    Optional<NsLcmOpOcc> findById(final String id);
+}
 
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2020 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.etsi.nfvo.ns.lcm.database.repository;
+
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoJobStatus;
+import org.springframework.data.repository.CrudRepository;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
+ */
+public interface NfvoJobStatusRepository extends CrudRepository<NfvoJobStatus, Integer> {
+}
 
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2020 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.etsi.nfvo.ns.lcm.database.repository;
+
+import java.util.List;
+import java.util.Optional;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNfInst;
+import org.springframework.data.repository.CrudRepository;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ * @author mukeshsharma(mukeshsharma@est.tech)
+ */
+public interface NfvoNfInstRepository extends CrudRepository<NfvoNfInst, String> {
+
+    Optional<NfvoNfInst> findByNfInstId(final String nfInstId);
+
+    List<NfvoNfInst> findByNsInstNsInstId(final String nsInstId);
+
+    List<NfvoNfInst> findByNsInstNsInstIdAndName(final String nsInstId, final String name);
+}
 
  */
 package org.onap.so.etsi.nfvo.ns.lcm.database.service;
 
+import java.util.List;
 import java.util.Optional;
 import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoJob;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNfInst;
 import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNsInst;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpOcc;
+import org.onap.so.etsi.nfvo.ns.lcm.database.repository.NSLcmOpOccRepository;
 import org.onap.so.etsi.nfvo.ns.lcm.database.repository.NfvoJobRepository;
+import org.onap.so.etsi.nfvo.ns.lcm.database.repository.NfvoNfInstRepository;
 import org.onap.so.etsi.nfvo.ns.lcm.database.repository.NfvoNsInstRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
     private final NfvoNsInstRepository nfvoNsInstRepository;
 
+    private final NfvoNfInstRepository nfvoNfInstRepository;
+
+    private final NSLcmOpOccRepository nsLcmOpOccRepository;
+
     @Autowired
     public DatabaseServiceProvider(final NfvoJobRepository nfvoJobRepository,
-            final NfvoNsInstRepository nfvoNsInstRepository) {
+            final NfvoNsInstRepository nfvoNsInstRepository, final NfvoNfInstRepository nfvoNfInstRepository,
+            final NSLcmOpOccRepository nsLcmOpOccRepository) {
         this.nfvoJobRepository = nfvoJobRepository;
         this.nfvoNsInstRepository = nfvoNsInstRepository;
+        this.nfvoNfInstRepository = nfvoNfInstRepository;
+        this.nsLcmOpOccRepository = nsLcmOpOccRepository;
     }
 
     public boolean addJob(final NfvoJob job) {
         return nfvoNsInstRepository.findByName(name);
     }
 
-    public Optional<NfvoNsInst> getNfvoNsInstByNsInstId(final String nsInstId) {
-        logger.info("Querying database for NfvoNsInst using nsInstId: {}", nsInstId);
-        return nfvoNsInstRepository.findByNsInstId(nsInstId);
+    public boolean saveNfvoNfInst(final NfvoNfInst nfvoNfInst) {
+        logger.info("Saving NfvoNfInst: {} to database", nfvoNfInst);
+        return nfvoNfInstRepository.save(nfvoNfInst) != null;
+    }
+
+    public Optional<NfvoNfInst> getNfvoNfInstByNfInstId(final String nfInstId) {
+        logger.info("Querying database for NfvoNfInst using nfInstId: {}", nfInstId);
+        return nfvoNfInstRepository.findByNfInstId(nfInstId);
+    }
+
+    public List<NfvoNfInst> getNfvoNfInstByNsInstId(final String nsInstId) {
+        logger.info("Querying database for NfvoNfInst using nsInstId: {}", nsInstId);
+        return nfvoNfInstRepository.findByNsInstNsInstId(nsInstId);
     }
 
+    public List<NfvoNfInst> getNfvoNfInstByNsInstIdAndNfName(final String nsInstId, final String name) {
+        logger.info("Querying database for NfvoNfInst using nsInstId: {} and name : {} ", nsInstId, name);
+        return nfvoNfInstRepository.findByNsInstNsInstIdAndName(nsInstId, name);
+    }
+
+    public boolean addNSLcmOpOcc(final NsLcmOpOcc nsLcmOpOcc) {
+        logger.info("Adding NSLcmOpOcc: {} to database", nsLcmOpOcc);
+        return nsLcmOpOccRepository.save(nsLcmOpOcc) != null;
+    }
+
+    public Optional<NsLcmOpOcc> getNsLcmOpOcc(final String id) {
+        logger.info("Querying database for NsLcmOpOcc using id: {}", id);
+        return nsLcmOpOccRepository.findById(id);
+    }
+
+
+
 }
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import java.time.LocalDateTime;
+import java.util.List;
 import java.util.Optional;
 import java.util.UUID;
 import org.junit.Test;
 import org.onap.so.etsi.nfvo.ns.lcm.database.beans.JobStatusEnum;
 import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoJob;
 import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoJobStatus;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNfInst;
 import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNsInst;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpOcc;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpType;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.OperationStateEnum;
 import org.onap.so.etsi.nfvo.ns.lcm.database.beans.State;
 import org.onap.so.etsi.nfvo.ns.lcm.database.service.DatabaseServiceProvider;
 import org.springframework.beans.factory.annotation.Autowired;
         assertTrue(databaseServiceProvider.isNsInstExists(DUMMY_NAME));
     }
 
+    @Test
+    public void testAddNfInst_StoredInDatabase_ableTofindByQuery() {
+
+        final NfvoNsInst nsInst = new NfvoNsInst().name(DUMMY_NAME).nsdId(RANDOM_ID).status(State.NOT_INSTANTIATED)
+                .nsdInvariantId(RANDOM_ID).statusUpdatedTime(CURRENT_DATE_TIME);
+
+        databaseServiceProvider.saveNfvoNsInst(nsInst);
+
+        final NfvoNfInst nfInst = new NfvoNfInst().nfvoNsInst(nsInst).name(DUMMY_NAME).vnfdId(RANDOM_ID)
+                .status(State.NOT_INSTANTIATED).createTime(CURRENT_DATE_TIME).lastUpdateTime(CURRENT_DATE_TIME);
+        databaseServiceProvider.saveNfvoNfInst(nfInst);
+
+        final Optional<NfvoNfInst> actual = databaseServiceProvider.getNfvoNfInstByNfInstId(nfInst.getNfInstId());
+        final NfvoNfInst actualNfvoNfInst = actual.get();
+        assertEquals(nsInst.getNsInstId(), actualNfvoNfInst.getNsInst().getNsInstId());
+        assertEquals(nfInst.getNfInstId(), actualNfvoNfInst.getNfInstId());
+        assertEquals(nfInst.getName(), actualNfvoNfInst.getName());
+        assertEquals(nfInst.getVnfdId(), actualNfvoNfInst.getVnfdId());
+        assertEquals(nfInst.getStatus(), actualNfvoNfInst.getStatus());
+        assertEquals(nfInst.getCreateTime(), actualNfvoNfInst.getCreateTime());
+        assertEquals(nfInst.getLastUpdateTime(), actualNfvoNfInst.getLastUpdateTime());
+
+
+        List<NfvoNfInst> nfvoNfInstList = databaseServiceProvider.getNfvoNfInstByNsInstId(nsInst.getNsInstId());
+        assertFalse(nfvoNfInstList.isEmpty());
+        assertEquals(nsInst.getNsInstId(), nfvoNfInstList.get(0).getNsInst().getNsInstId());
+
+        nfvoNfInstList = databaseServiceProvider.getNfvoNfInstByNsInstIdAndNfName(nsInst.getNsInstId(), DUMMY_NAME);
+
+        assertFalse(nfvoNfInstList.isEmpty());
+        assertEquals(nsInst.getNsInstId(), nfvoNfInstList.get(0).getNsInst().getNsInstId());
+        assertEquals(DUMMY_NAME, nfvoNfInstList.get(0).getName());
+    }
+
+    @Test
+    public void testAddNsLcmOpOcc_StoredInDatabase_ableTofindByQuery() {
+
+        final NfvoNsInst nsInst = new NfvoNsInst().name(DUMMY_NAME).nsdId(RANDOM_ID).status(State.NOT_INSTANTIATED)
+                .nsdInvariantId(RANDOM_ID).statusUpdatedTime(CURRENT_DATE_TIME);
+
+        databaseServiceProvider.saveNfvoNsInst(nsInst);
+
+        final NsLcmOpOcc nsLcmOpOcc = new NsLcmOpOcc().nfvoNsInst(nsInst).operationState(OperationStateEnum.PROCESSING)
+                .isCancelPending(false).isAutoInnovation(false).operation(NsLcmOpType.INSTANTIATE)
+                .startTime(CURRENT_DATE_TIME).stateEnteredTime(CURRENT_DATE_TIME).operationParams("");
+
+
+        databaseServiceProvider.addNSLcmOpOcc(nsLcmOpOcc);
+
+        final Optional<NsLcmOpOcc> actual = databaseServiceProvider.getNsLcmOpOcc(nsLcmOpOcc.getId());
+        final NsLcmOpOcc actualLcmOpOcc = actual.get();
+        assertEquals(nsLcmOpOcc.getId(), actualLcmOpOcc.getId());
+
+        assertEquals(nsInst.getNsInstId(), actualLcmOpOcc.getNfvoNsInst().getNsInstId());
+
+    }
 }
 
       generate-ddl: true
       hibernate:
          ddl-auto: create
-         
-logging:
-   level:
-      org.flywaydb: DEBUG
 hibernate:
    dialect: org.hibernate.dialect.H2Dialect
    hbm2ddl: