diff options
Diffstat (limited to 'adapters/mso-requests-db-adapter/src/main/java')
3 files changed, 6 insertions, 4 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java index 28c56b32cd..25df0a7c1e 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java @@ -150,9 +150,9 @@ public class ArchiveInfraRequestsScheduler { } logger.info("Creating archivedInfraRequest records: " + newArchivedReqs.size()); - archivedInfraRepo.save(newArchivedReqs); + archivedInfraRepo.saveAll(newArchivedReqs); logger.info("Deleting InfraActiveRequest records: "+ oldInfraReqs.size()); - infraActiveRepo.delete(oldInfraReqs); + infraActiveRepo.deleteAll(oldInfraReqs); } } diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index 33b1028cbb..dc6abce759 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -264,7 +264,9 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { String resourceTemplateUUID) throws MsoRequestsDbException { return resourceOperationStatusRepository - .findOne(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID)); + .findById(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID)). + orElseThrow( () -> new MsoRequestsDbException("Operation not found:" + operationId)); + } /** diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java index bc1e17b067..99fa770974 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java @@ -25,7 +25,7 @@ import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; +import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; |