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 Type
    Method
    Description
    boolean
    existsByIdAndBusinessId(Long collectionId, Long businessId)
    existsByIdAndBusinessId - To check if a collection exists for the given collectionId and businessId.
    boolean
     
    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

      @EntityGraph(attributePaths="properties") Optional<CollectionEntity> findById(Long id)
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<CollectionEntity,Long>
    • findByName

      Optional<CollectionEntity> findByName(String collectionName)
      findByName - To find a collection for the given name.
      Parameters:
      collectionName - The collection name.
      Returns:
      collection.
    • findByNameAndBusinessId

      Optional<CollectionEntity> findByNameAndBusinessId(String collectionName, Long businessId)
      findByNameAndBusinessId - To find a collection for the given name and businessId.
      Parameters:
      collectionName - The collection name.
      businessId - The business Id.
      Returns:
      collection.
    • findByIdAndBusinessId

      Optional<CollectionEntity> findByIdAndBusinessId(Long collectionId, Long businessId)
      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 of Specification of CollectionEntity obejct for loading all collections from DB.
      pageRequest - Instance of Pageable object.
      Returns:
      the Page of CollectionEntity object.
    • existsByIdAndBusinessId

      boolean existsByIdAndBusinessId(Long collectionId, Long businessId)
      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

      boolean existsByNameIgnoreCaseAndBusinessId(String name, long businessId)
      Parameters:
      name - name of the collection
      businessId - id of the business
      Returns:
      true, if successful