Package com.skava.list.repository
Interface ListRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<ListEntity,
,String> org.springframework.data.repository.ListCrudRepository<ListEntity,
,String> org.springframework.data.repository.ListPagingAndSortingRepository<ListEntity,
,String> org.springframework.data.mongodb.repository.MongoRepository<ListEntity,
,String> org.springframework.data.repository.PagingAndSortingRepository<ListEntity,
,String> org.springframework.data.repository.query.QueryByExampleExecutor<ListEntity>
,org.springframework.data.querydsl.QuerydslPredicateExecutor<ListEntity>
,org.springframework.data.repository.Repository<ListEntity,
String>
public interface ListRepository
extends org.springframework.data.mongodb.repository.MongoRepository<ListEntity,String>, org.springframework.data.querydsl.QuerydslPredicateExecutor<ListEntity>
ListRepository class
This class contain constants that are used to the interface list of repository.
-
Method Summary
Modifier and TypeMethodDescriptionlong
countByCollectionIdAndTypeAndUserId
(Long collectionId, String type, String userId) Getting the list countlong
countByCollectionIdAndUserId
(Long collectionId, String userId) Getting the list countvoid
deleteByCollectionIdAndId
(Long collectionId, String id) Delete by id and collection id.boolean
existsByCollectionIdAndId
(Long collectionId, String id) Exists by id and collection id.boolean
existsByCollectionIdAndIdAndUserId
(Long collectionId, String id, String userId) Exists by user id and Id and collection id.boolean
existsByCollectionIdAndTypeAndUserId
(Long collectionId, String type, String userId) Exists by user id and type and collection id.boolean
existsByCollectionIdAndUserIdAndName
(Long collectionId, String userId, String name) Check if the property exists by user Id, name and collection id.boolean
existsByCollectionIdAndUserIdAndNameIgnoreCase
(Long collectionId, String userId, String name) Check if the property exists by user Id, name and collection id (Case Insensetive).long
existsByListItemId
(Long collectionId, String listId, String listItemId) find the count of list item matching paramslong
existsByListItemKey
(Long collectionId, String listId, String key, String storeId) find the count of list item matching paramsorg.springframework.data.domain.Page<ListEntity>
findAll
(org.springframework.data.domain.Pageable pageRequest) findAllByListItem
(Long collectionId, String listId, int page, int size) find all the list item matching params considering the page and sizefindAllByUserId
(String userId) Find all by user id and collection id.findByCollectionIdAndId
(Long collectionId, String id) Find by id and collection id.findByListItem
(Long collectionId, String listId, String listItemId) find the list item matching paramsMethods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
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.mongodb.repository.MongoRepository
findAll, findAll, insert, insert
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
-
findAll
org.springframework.data.domain.Page<ListEntity> findAll(org.springframework.data.domain.Pageable pageRequest) - Specified by:
findAll
in interfaceorg.springframework.data.repository.PagingAndSortingRepository<ListEntity,
String>
-
findAllByUserId
Find all by user id and collection id.- Parameters:
userId
- Refers to the ID of the user for which the list is created.- Returns:
- the list
-
findByCollectionIdAndId
Find by id and collection id.- Parameters:
id
- Indicates the unique identifier of the list. This field is generated automatically.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- the optional
-
existsByCollectionIdAndId
Exists by id and collection id.- Parameters:
id
- Indicates the unique identifier of the list. This field is generated automatically.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- true, if successful
-
deleteByCollectionIdAndId
Delete by id and collection id.- Parameters:
id
- Indicates the unique identifier of the list. This field is generated automatically.collectionId
- Refers to the collection ID of the list for which the list is created.
-
existsByCollectionIdAndUserIdAndName
Check if the property exists by user Id, name and collection id.- Parameters:
userId
- Refers to the ID of the user for which the list is created.name
- Refers to the name of the list. The name of the list is unique for a user within a collection.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- the existence of the list
-
existsByCollectionIdAndTypeAndUserId
Exists by user id and type and collection id.- Parameters:
userId
- Refers to the ID of the user for which the list is created.type
- Refers the list type.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- true, if successful
-
countByCollectionIdAndTypeAndUserId
Getting the list count- Parameters:
userId
- Refers to the ID of the user for which the list is created.type
- Refers the list type.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- long value
-
countByCollectionIdAndUserId
Getting the list count- Parameters:
collectionId
- Refers to the collection ID of the list for which the list is created.userId
- Refers to the ID of the user for which the list is created.- Returns:
- long value
-
findByListItem
@Query(value="{\'listItems._id\' : ?2 , \'_id\': ?1, \'collectionId\' : ?0 }", fields="{listItems: 1}") Optional<ListEntity> findByListItem(Long collectionId, String listId, String listItemId) find the list item matching params- Parameters:
listItemId
- Indicates the unique valid ID of the list item.listId
- Holds the unique valid ID of the list.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- list entity
-
existsByListItemKey
@Query(value="{\'listItems.key\' : ?2 , \'listItems.storeId\' : ?3, \'_id\': ?1, \'collectionId\' : ?0 }", fields="{_id: 1}", count=true) long existsByListItemKey(Long collectionId, String listId, String key, String storeId) find the count of list item matching params- Parameters:
key
- Refers to the item key.storeId
- item storeidlistId
- Holds the unique valid ID of the list.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- count
-
existsByListItemId
@Query(value="{\'listItems._id\' : ?2 , \'_id\': ?1, \'collectionId\' : ?0 }", fields="{_id: 1}", count=true) long existsByListItemId(Long collectionId, String listId, String listItemId) find the count of list item matching params- Parameters:
listItemId
- Indicates the unique valid ID of the list item.listId
- Holds the unique valid ID of the list.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- count
-
findAllByListItem
@Query(value="{\'_id\': ?1, \'collectionId\' : ?0 }", fields="{listItems: {\'$slice\' :[?2, ?3] }}") ListEntity findAllByListItem(Long collectionId, String listId, int page, int size) find all the list item matching params considering the page and size- Parameters:
listId
- Holds the unique valid ID of the list.collectionId
- Refers to the collection ID of the list for which the list is created.page
- Specifies the number of pages to be retrieved in the response.size
- Specifies the number of records to be rendered in a page.- Returns:
- list entities
-
existsByCollectionIdAndUserIdAndNameIgnoreCase
boolean existsByCollectionIdAndUserIdAndNameIgnoreCase(Long collectionId, String userId, String name) Check if the property exists by user Id, name and collection id (Case Insensetive).- Parameters:
userId
- Refers to the ID of the user for which the list is created.name
- Refers to the name of the list. The name of the list is unique for a user within a collection.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- the existence of the list
-
existsByCollectionIdAndIdAndUserId
Exists by user id and Id and collection id.- Parameters:
userId
- Refers to the ID of the user for which the list is created.id
- Indicates the unique identifier of the list.collectionId
- Refers to the collection ID of the list for which the list is created.- Returns:
- true, if successful
-