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 Details

    • findAll

      org.springframework.data.domain.Page<ListEntity> findAll(org.springframework.data.domain.Pageable pageRequest)
      Specified by:
      findAll in interface org.springframework.data.repository.PagingAndSortingRepository<ListEntity,String>
    • findAllByUserId

      List<ListEntity> findAllByUserId(String userId)
      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

      Optional<ListEntity> findByCollectionIdAndId(Long collectionId, String id)
      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

      boolean existsByCollectionIdAndId(Long collectionId, String id)
      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

      void deleteByCollectionIdAndId(Long collectionId, String id)
      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

      boolean existsByCollectionIdAndUserIdAndName(Long collectionId, String userId, String name)
      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

      boolean existsByCollectionIdAndTypeAndUserId(Long collectionId, String type, String userId)
      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

      long countByCollectionIdAndTypeAndUserId(Long collectionId, String type, String userId)
      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

      long countByCollectionIdAndUserId(Long collectionId, String userId)
      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 storeid
      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
    • 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

      boolean existsByCollectionIdAndIdAndUserId(Long collectionId, String id, String userId)
      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