diff options
Diffstat (limited to 'cps-ri/src/main/java/org/onap/cps/spi/repository/DataspaceRepository.java')
-rwxr-xr-x | cps-ri/src/main/java/org/onap/cps/spi/repository/DataspaceRepository.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/DataspaceRepository.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/DataspaceRepository.java index ce231c9c5..10c6541d0 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/DataspaceRepository.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/DataspaceRepository.java @@ -21,16 +21,15 @@ package org.onap.cps.spi.repository; import java.util.Optional; import javax.validation.constraints.NotNull; -import org.onap.cps.spi.entities.Dataspace; +import org.onap.cps.spi.entities.DataspaceEntity; import org.onap.cps.spi.exceptions.DataspaceNotFoundException; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository -public interface DataspaceRepository extends JpaRepository<Dataspace, Integer> { - Boolean existsByName(String name); //Checks if there are any records by name() +public interface DataspaceRepository extends JpaRepository<DataspaceEntity, Integer> { - Optional<Dataspace> findByName(@NotNull String name); + Optional<DataspaceEntity> findByName(@NotNull String name); /** * Get a dataspace by name. @@ -39,7 +38,7 @@ public interface DataspaceRepository extends JpaRepository<Dataspace, Integer> { * @param name the name of the dataspace * @return the Dataspace found */ - default Dataspace getByName(@NotNull final String name) { + default DataspaceEntity getByName(@NotNull final String name) { return findByName(name).orElseThrow(() -> new DataspaceNotFoundException(name)); } } |