Interface StoreRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Store,Long>, org.springframework.data.jpa.repository.JpaRepository<Store,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<Store>, org.springframework.data.repository.ListCrudRepository<Store,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Store,Long>, org.springframework.data.repository.PagingAndSortingRepository<Store,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Store>, org.springframework.data.querydsl.QuerydslPredicateExecutor<Store>, org.springframework.data.repository.Repository<Store,Long>

public interface StoreRepository extends org.springframework.data.jpa.repository.JpaRepository<Store,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<Store>, org.springframework.data.querydsl.QuerydslPredicateExecutor<Store>

Implementation of generic CRUD operations on a repository for store.

Since:
8.0
Version:
8.0
Author:
Infosys Equinox
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.data.domain.Page<Store>
    findAllByBusinessId(long businessId, org.springframework.data.jpa.domain.Specification<Store> specification, org.springframework.data.domain.Pageable pageable)
    Loads all stores based on pageable (page, size, sort) and search.
    findAllStores(Set<Long> storeIds)
     
     
    findByBusinessId(long businessId, long storeId)
    Loads store based on given storeId and businessId

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, 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.jpa.repository.JpaSpecificationExecutor

    count, delete, exists, findAll, findAll, findAll, findBy, findOne

    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

    • findAllByBusinessId

      @Query("SELECT s FROM Store s WHERE s.businessId = ?1") org.springframework.data.domain.Page<Store> findAllByBusinessId(long businessId, org.springframework.data.jpa.domain.Specification<Store> specification, org.springframework.data.domain.Pageable pageable)
      Loads all stores based on pageable (page, size, sort) and search.
      Parameters:
      businessId - Contains business id
      specification - Instance of Specification.
      pageable - Instance of Pageable.
      Returns:
      List of Store.
    • findByBusinessId

      @Query("SELECT s FROM Store s WHERE s.businessId = ?1 AND id=?2") Optional<Store> findByBusinessId(long businessId, long storeId)
      Loads store based on given storeId and businessId
      Parameters:
      businessId - Contains business id
      storeId - Contains store id
      Returns:
      List of Store.
    • findBusinessIdByStoreId

      @Query(value="SELECT business_id FROM store WHERE id=?1", nativeQuery=true) Long findBusinessIdByStoreId(long storeId)
    • findAllStores

      @Query(value="SELECT * FROM store where id in (?1) ", nativeQuery=true) List<Store> findAllStores(Set<Long> storeIds)