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>
This is CollectionRepository interface. Interface for generic CRUD operations of the Collection entity. This handles the below operations.
  • Create
  • Read
  • Update
Author:
Infosys Equinox
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    existsByIdAndBusinessId(Long collectionId, Long businessId)
    This is used to check whether the given collection is present within business id
    boolean
    This method is used to check whether the given collection name by ignoring case sensitive and business id.
    org.springframework.data.domain.Page<CollectionEntity>
    findAll(org.springframework.data.jpa.domain.Specification<CollectionEntity> specification, org.springframework.data.domain.Pageable pageable)
    This is used to find all collection objects based on specification and Pageable.
    findById(Long collectionId)
    This is used to load the collection by collection id.
    findByIdAndBusinessId(Long collectionId, Long businessId)
    This is used to load the collection by collection id and business id.
    findByName(String collectionName)
    This is used to load the collection by name.
    findByNameAndBusinessId(String collectionName, Long businessId)
    This is used to load the collection by name and business Id.

    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

    • findByName

      Optional<CollectionEntity> findByName(String collectionName)
      This is used to load the collection by name.
      Parameters:
      collectionName - Indicates the collection name.
      Returns:
      The Optional of CollectionEntity object.
    • findByNameAndBusinessId

      Optional<CollectionEntity> findByNameAndBusinessId(String collectionName, Long businessId)
      This is used to load the collection by name and business Id.
      Parameters:
      collectionName - Indicates the collection name for loading collection.
      businessId - Indicates the business id.
      Returns:
      The Optional of CollectionEntity object.
    • findByIdAndBusinessId

      Optional<CollectionEntity> findByIdAndBusinessId(Long collectionId, Long businessId)
      This is used to load the collection by collection id and business id.
      Parameters:
      collectionId - Indicates the collection id.
      businessId - Indicates the business id.
      Returns:
      The Optional of CollectionEntity object.
    • findById

      Optional<CollectionEntity> findById(Long collectionId)
      This is used to load the collection by collection id.
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<CollectionEntity,Long>
      Parameters:
      collectionId - Indicates the collection id for loading collection.
      Returns:
      The Optional of CollectionEntity object.
    • findAll

      org.springframework.data.domain.Page<CollectionEntity> findAll(org.springframework.data.jpa.domain.Specification<CollectionEntity> specification, org.springframework.data.domain.Pageable pageable)
      This is used to find all collection objects based on specification and Pageable.
      Parameters:
      specification - Holds the Specification of CollectionEntity object.
      pageable - Holds Pageable object.
      Returns:
      The Page of CollectionEntity object.
    • existsByIdAndBusinessId

      boolean existsByIdAndBusinessId(Long collectionId, Long businessId)
      This is used to check whether the given collection is present within business id
      Parameters:
      collectionId - Indicates the collection id for which the collection is checked.
      businessId - Indicates the business id for which the collection is checked.
      Returns:
      True if collection exist by collection id and business id.
    • existsByNameIgnoreCaseAndBusinessId

      boolean existsByNameIgnoreCaseAndBusinessId(String name, long businessId)
      This method is used to check whether the given collection name by ignoring case sensitive and business id.
      Parameters:
      name - Indicates the name of the collection for checking the case sensitive in collection name.
      businessId - Indicates the business id of the collection.
      Returns:
      True, if collection exist by businessid and name by case sensitive.