Interface ProductJpaRepository

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

public interface ProductJpaRepository extends org.springframework.data.jpa.repository.JpaRepository<ProductJpaEntity,Long>
Spring Data repository owned by catalog infrastructure. Other modules call catalog application services instead of depending on this repository.
  • Method Summary

    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.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
  • Method Details

    • findByIdForUpdate

      @Lock(PESSIMISTIC_WRITE) @Query("select p from CatalogProduct p where p.id = :id") Optional<ProductJpaEntity> findByIdForUpdate(@Param("id") Long id)
    • findAllProductViews

      @Query("select new com.dmasone.identity.catalog.application.ProductView(\n p.id,\n p.sku,\n p.name,\n p.price,\n p.availableQuantity\n)\nfrom CatalogProduct p\norder by p.id\n") List<ProductView> findAllProductViews()
    • findProductViewById

      @Query("select new com.dmasone.identity.catalog.application.ProductView(\n p.id,\n p.sku,\n p.name,\n p.price,\n p.availableQuantity\n)\nfrom CatalogProduct p\nwhere p.id = :id\n") Optional<ProductView> findProductViewById(@Param("id") Long id)