Package africa.absa.inception.config
Interface ConfigRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Config,,String> org.springframework.data.jpa.repository.JpaRepository<Config,,String> org.springframework.data.repository.PagingAndSortingRepository<Config,,String> org.springframework.data.repository.query.QueryByExampleExecutor<Config>,org.springframework.data.repository.Repository<Config,String>
public interface ConfigRepository
extends org.springframework.data.jpa.repository.JpaRepository<Config,String>
The ConfigRepository interface declares the repository for the Config domain type.
- Author:
- Marcus Portmann
-
Method Summary
Modifier and TypeMethodDescriptionvoidDelete the config with the specified key.booleanCheck whether the config exists.Retrieve all the configs ordered by key descending.Retrieve the config.findByKeyIgnoreCaseContaining(String filter) Retrieve the filtered configs.Retrieve the value for the config.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findOne
-
Method Details
-
deleteByKeyIgnoreCase
Delete the config with the specified key.- Parameters:
key- the key for the config
-
existsByKeyIgnoreCase
Check whether the config exists.- Parameters:
key- the key for the config- Returns:
- true if the config exists or false otherwise
-
findAllByOrderByKeyDesc
Retrieve all the configs ordered by key descending.- Returns:
- all the configs ordered by key descending
-
findByKeyIgnoreCase
Retrieve the config.- Parameters:
key- the key for the config- Returns:
- an Optional containing the config or an empty Optional if the config could not be found
-
findByKeyIgnoreCaseContaining
Retrieve the filtered configs.- Parameters:
filter- the filter to apply to the keys for the configs- Returns:
- the filtered configs
-
getValueByKeyIgnoreCase
@Query("select c.value from Config c where lower(c.key) = lower(:key)") Optional<String> getValueByKeyIgnoreCase(@Param("key") String key) Retrieve the value for the config.- Parameters:
key- the key for the config- Returns:
- an Optional containing the value for the config or an empty Optional if the config could not be found
-