Interface CostCenterRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<CostCenter,,CostCenter.Id> org.springframework.data.jpa.repository.JpaRepository<CostCenter,,CostCenter.Id> org.springframework.data.repository.ListCrudRepository<CostCenter,,CostCenter.Id> org.springframework.data.repository.ListPagingAndSortingRepository<CostCenter,,CostCenter.Id> org.springframework.data.repository.PagingAndSortingRepository<CostCenter,,CostCenter.Id> org.springframework.data.repository.query.QueryByExampleExecutor<CostCenter>,org.springframework.data.repository.Repository<CostCenter,CostCenter.Id>
public interface CostCenterRepository
extends org.springframework.data.jpa.repository.JpaRepository<CostCenter,CostCenter.Id>
-
Method Summary
Modifier and TypeMethodDescriptionfindAllByOrganisationIdWithParentAndChildren(String organisationId) findByIdAndActive(CostCenter.Id Id, boolean active) 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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findAllByOrganisationIdWithParentAndChildren
@Query("SELECT DISTINCT t FROM CostCenter t LEFT JOIN FETCH t.parent LEFT JOIN FETCH t.children WHERE t.id.organisationId = :organisationId") Set<CostCenter> findAllByOrganisationIdWithParentAndChildren(@Param("organisationId") String organisationId) -
findByIdAndActive
@Query("SELECT t FROM CostCenter t WHERE t.id = :Id AND t.active = :active ") Optional<CostCenter> findByIdAndActive(@Param("Id") CostCenter.Id Id, @Param("active") boolean active)
-