Package com.skava.repository
Interface CollectionRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<CollectionEntity,
,Long> org.springframework.data.jpa.repository.JpaRepository<CollectionEntity,
,Long> org.springframework.data.repository.ListCrudRepository<CollectionEntity,
,Long> org.springframework.data.repository.ListPagingAndSortingRepository<CollectionEntity,
,Long> org.springframework.data.repository.PagingAndSortingRepository<CollectionEntity,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<CollectionEntity>
,org.springframework.data.querydsl.QuerydslPredicateExecutor<CollectionEntity>
,org.springframework.data.repository.Repository<CollectionEntity,
Long>
public interface CollectionRepository
extends org.springframework.data.jpa.repository.JpaRepository<CollectionEntity,Long>, org.springframework.data.querydsl.QuerydslPredicateExecutor<CollectionEntity>
The Interface CollectionRepository provides generic CRUD operations for the CollectionEntity.
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionboolean
existsByIdAndBusinessId
(Long collectionId, Long businessId) existsByIdAndBusinessId - To check if a collection exists for the given collectionId and businessId.boolean
existsByNameIgnoreCaseAndBusinessId
(String name, long businessId) org.springframework.data.domain.Page<CollectionEntity>
findAll
(org.springframework.data.jpa.domain.Specification<CollectionEntity> specification, org.springframework.data.domain.Pageable pageRequest) findAll - To find all the collections according to the given specification.findByIdAndBusinessId
(Long collectionId, Long businessId) findByIdAndBusinessId - To find a collection for the given collectionId and businessId.findByName
(String collectionName) findByName - To find a collection for the given name.findByNameAndBusinessId
(String collectionName, Long businessId) findByNameAndBusinessId - To find a collection for the given name and businessId.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, save
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAll
Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
Methods inherited from interface org.springframework.data.querydsl.QuerydslPredicateExecutor
count, exists, findAll, findAll, findAll, findAll, findAll, findBy, findOne
-
Method Details
-
findById
- Specified by:
findById
in interfaceorg.springframework.data.repository.CrudRepository<CollectionEntity,
Long>
-
findByName
findByName - To find a collection for the given name.- Parameters:
collectionName
- The collection name.- Returns:
- collection.
-
findByNameAndBusinessId
findByNameAndBusinessId - To find a collection for the given name and businessId.- Parameters:
collectionName
- The collection name.businessId
- The business Id.- Returns:
- collection.
-
findByIdAndBusinessId
findByIdAndBusinessId - To find a collection for the given collectionId and businessId.- Parameters:
collectionId
- Identifier of collection.businessId
- Identifier of business.- Returns:
- auth collection.
-
findAll
org.springframework.data.domain.Page<CollectionEntity> findAll(org.springframework.data.jpa.domain.Specification<CollectionEntity> specification, org.springframework.data.domain.Pageable pageRequest) findAll - To find all the collections according to the given specification.- Parameters:
specification
- Instance ofSpecification
ofCollectionEntity
obejct for loading all collections from DB.pageRequest
- Instance ofPageable
object.- Returns:
- the
Page
ofCollectionEntity
object.
-
existsByIdAndBusinessId
existsByIdAndBusinessId - To check if a collection exists for the given collectionId and businessId.- Parameters:
collectionId
- Identifier of collection.businessId
- Identifier of business.- Returns:
- boolean value true/false ie., if it exists or not.
-
existsByNameIgnoreCaseAndBusinessId
- Parameters:
name
- name of the collectionbusinessId
- id of the business- Returns:
- true, if successful
-