Loading src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCandidateService.java +5 −1 Original line number Diff line number Diff line Loading @@ -143,6 +143,10 @@ public class ServiceCandidateService { @Transactional public ServiceCandidateEntity getServiceCandidateById(String id) { return getServiceCandidateEntity(id); } private ServiceCandidateEntity getServiceCandidateEntity(String id) { Optional<ServiceCandidateEntity> serviceCandidate = serviceCandidateRepository.findById(id); if (serviceCandidate.isPresent()) { return serviceCandidate.get(); Loading Loading @@ -219,7 +223,7 @@ public class ServiceCandidateService { @Transactional public ServiceCandidateEntity deleteServiceCandidate(String id) { ServiceCandidateEntity serviceCandidate = getServiceCandidateById(id); ServiceCandidateEntity serviceCandidate = this.getServiceCandidateEntity(id); serviceCandidate.setServiceSpecification(null); serviceCandidateRepository.persist(serviceCandidate); serviceCandidateRepository.delete(serviceCandidate); Loading src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCatalogService.java +5 −1 Original line number Diff line number Diff line Loading @@ -169,6 +169,10 @@ public class ServiceCatalogService { @Transactional public ServiceCatalogEntity getById(String id) { return getServiceCatalogEntity(id); } private ServiceCatalogEntity getServiceCatalogEntity(String id) { Optional<ServiceCatalogEntity> serviceCatalogue = serviceCatalogRepository.findById(id); if (serviceCatalogue.isPresent()) { return serviceCatalogue.get(); Loading Loading @@ -368,7 +372,7 @@ public class ServiceCatalogService { @Transactional public ServiceCatalogEntity deleteServiceCatalog(String id) { ServiceCatalogEntity serviceCatalogEntity = getById(id); ServiceCatalogEntity serviceCatalogEntity = this.getServiceCatalogEntity(id); serviceCatalogRepository.delete(serviceCatalogEntity); return serviceCatalogEntity; } Loading src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCategoryService.java +7 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import org.etsi.osl.hypo.api.tmf.services.catalog.api.repository.ServiceCategory import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceCandidateEntity; import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceCategoryEntity; import org.jboss.logging.Logger; import org.jspecify.annotations.NonNull; @ApplicationScoped public class ServiceCategoryService { Loading Loading @@ -162,6 +163,10 @@ public class ServiceCategoryService { @Transactional public ServiceCategoryEntity getById(String id) { return getServiceCategoryEntity(id); } private @NonNull ServiceCategoryEntity getServiceCategoryEntity(String id) { Optional<ServiceCategoryEntity> serviceCategory = serviceCategoryRepository.findById(id); if (serviceCategory.isPresent()) { return serviceCategory.get(); Loading @@ -169,11 +174,6 @@ public class ServiceCategoryService { throw new ServiceNotFoundException("Service Category with id " + id + " not found"); } @Transactional public Optional<ServiceCategoryEntity> findCategoryById(String id) { return serviceCategoryRepository.findById(id); } @Transactional public Optional<ServiceCategoryEntity> findServiceCategoryByName(String categoryName) { return serviceCategoryRepository.findByName(categoryName); Loading Loading @@ -246,10 +246,9 @@ public class ServiceCategoryService { } @Transactional public ServiceCategoryEntity deleteServiceCategory(String id) { ServiceCategoryEntity serviceCategory = getById(id); public void deleteServiceCategory(String id) { ServiceCategoryEntity serviceCategory = this.getServiceCategoryEntity(id); serviceCategoryRepository.delete(serviceCategory); return serviceCategory; } @Transactional Loading Loading
src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCandidateService.java +5 −1 Original line number Diff line number Diff line Loading @@ -143,6 +143,10 @@ public class ServiceCandidateService { @Transactional public ServiceCandidateEntity getServiceCandidateById(String id) { return getServiceCandidateEntity(id); } private ServiceCandidateEntity getServiceCandidateEntity(String id) { Optional<ServiceCandidateEntity> serviceCandidate = serviceCandidateRepository.findById(id); if (serviceCandidate.isPresent()) { return serviceCandidate.get(); Loading Loading @@ -219,7 +223,7 @@ public class ServiceCandidateService { @Transactional public ServiceCandidateEntity deleteServiceCandidate(String id) { ServiceCandidateEntity serviceCandidate = getServiceCandidateById(id); ServiceCandidateEntity serviceCandidate = this.getServiceCandidateEntity(id); serviceCandidate.setServiceSpecification(null); serviceCandidateRepository.persist(serviceCandidate); serviceCandidateRepository.delete(serviceCandidate); Loading
src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCatalogService.java +5 −1 Original line number Diff line number Diff line Loading @@ -169,6 +169,10 @@ public class ServiceCatalogService { @Transactional public ServiceCatalogEntity getById(String id) { return getServiceCatalogEntity(id); } private ServiceCatalogEntity getServiceCatalogEntity(String id) { Optional<ServiceCatalogEntity> serviceCatalogue = serviceCatalogRepository.findById(id); if (serviceCatalogue.isPresent()) { return serviceCatalogue.get(); Loading Loading @@ -368,7 +372,7 @@ public class ServiceCatalogService { @Transactional public ServiceCatalogEntity deleteServiceCatalog(String id) { ServiceCatalogEntity serviceCatalogEntity = getById(id); ServiceCatalogEntity serviceCatalogEntity = this.getServiceCatalogEntity(id); serviceCatalogRepository.delete(serviceCatalogEntity); return serviceCatalogEntity; } Loading
src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCategoryService.java +7 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import org.etsi.osl.hypo.api.tmf.services.catalog.api.repository.ServiceCategory import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceCandidateEntity; import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceCategoryEntity; import org.jboss.logging.Logger; import org.jspecify.annotations.NonNull; @ApplicationScoped public class ServiceCategoryService { Loading Loading @@ -162,6 +163,10 @@ public class ServiceCategoryService { @Transactional public ServiceCategoryEntity getById(String id) { return getServiceCategoryEntity(id); } private @NonNull ServiceCategoryEntity getServiceCategoryEntity(String id) { Optional<ServiceCategoryEntity> serviceCategory = serviceCategoryRepository.findById(id); if (serviceCategory.isPresent()) { return serviceCategory.get(); Loading @@ -169,11 +174,6 @@ public class ServiceCategoryService { throw new ServiceNotFoundException("Service Category with id " + id + " not found"); } @Transactional public Optional<ServiceCategoryEntity> findCategoryById(String id) { return serviceCategoryRepository.findById(id); } @Transactional public Optional<ServiceCategoryEntity> findServiceCategoryByName(String categoryName) { return serviceCategoryRepository.findByName(categoryName); Loading Loading @@ -246,10 +246,9 @@ public class ServiceCategoryService { } @Transactional public ServiceCategoryEntity deleteServiceCategory(String id) { ServiceCategoryEntity serviceCategory = getById(id); public void deleteServiceCategory(String id) { ServiceCategoryEntity serviceCategory = this.getServiceCategoryEntity(id); serviceCategoryRepository.delete(serviceCategory); return serviceCategory; } @Transactional Loading