Package com.skava.price.repository
Interface MultiPriceRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Price,
,Long> CustomQuerydslPredicateExecutor<Price>
,org.springframework.data.querydsl.QuerydslPredicateExecutor<Price>
,org.springframework.data.repository.Repository<Price,
Long>
@CacheConfig(cacheNames="Multi_Price_Cache")
public interface MultiPriceRepository
extends org.springframework.data.repository.CrudRepository<Price,Long>, CustomQuerydslPredicateExecutor<Price>
Handles CRUD operations of MultiPrice entity.
- Since:
- 8.0
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptiondefault Price
createOrUpdatePrice
(long collectionId, Price price, LocalDateTime startTime, LocalDateTime endTime) findByIdAndPriceListIdAndProjectIdAndVersion
(long id, long priceListId, long projectId, String version) Retrieves MultiPrice record by Id , PriceListId and versionvoid
updateSkuStatus
(long priceId, String skuId, long priceListId, long projectId, String version) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
Methods inherited from interface com.skava.price.repository.CustomQuerydslPredicateExecutor
findAll
Methods inherited from interface org.springframework.data.querydsl.QuerydslPredicateExecutor
count, exists, findAll, findAll, findAll, findAll, findAll, findBy, findOne
-
Method Details
-
findByIdAndPriceListIdAndProjectIdAndVersion
Optional<Price> findByIdAndPriceListIdAndProjectIdAndVersion(long id, long priceListId, long projectId, String version) Retrieves MultiPrice record by Id , PriceListId and version- Parameters:
id
- MultiPrice IdentifierpriceListId
- PriList IdentifierprojectId
- Project Identifierversion
- version identifier- Returns:
- MultiPrice values
-
createOrUpdatePrice
@CacheEvict(key="\'COL-ID_\'+#collectionId+\'*findEarlyEndTimePrice_\'+#price.priceListId+\'_\'+#price.projectId+\'_\'+#price.skuId+\'_\'+#price.version+\'_\'+#price.startTime",condition="#price!=null") @CacheEvict(key="\'COL-ID_\'+#collectionId+\'*findEarlyEndTimePrice_\'+#price.priceListId+\'_\'+#price.projectId+\'_\'+#price.skuId+\'_\'+#price.version+\'_\'+#startTime",condition="#price!=null") @CacheEvict(key="\'COL-ID_\'+#collectionId+\'*getAllExactPrice_\'+#price.priceListId+\'_\'+#price.projectId+\'_\'+#price.skuId+\'_\'+#price.version+\'_\'+#price.startTime+\'_\'+#price.endTime",condition="#price!=null") @CacheEvict(key="\'COL-ID_\'+#collectionId+\'*getAllExactPrice_\'+#price.priceListId+\'_\'+#price.projectId+\'_\'+#price.skuId+\'_\'+#price.version+\'_\'+#startTime+\'_\'+#endTime",condition="#price!=null") @CacheEvict(key="\'COL-ID_\'+#collectionId+\'*getAllExactPrice_\'+#price.priceListId+\'_\'+#price.projectId+\'_\'+#price.skuId+\'_\'+#price.version+\'_null_null\'",condition="#price!=null") @CacheEvict(cacheNames="prceListSkuCountCache",key="\'COL-ID_\'+#collectionId+#price.priceListId+\'_\'+#price.projectId+\'_\'+#price.version",condition="#price!=null") default Price createOrUpdatePrice(long collectionId, Price price, LocalDateTime startTime, LocalDateTime endTime) - Parameters:
collectionId
- collection Identifierprice
- price ObjectstartTime
- startTime of PriceendTime
- EndTime of Price- Returns:
-
updateSkuStatus
@Modifying @Query(value="UPDATE prices SET status=\'DELETED\' WHERE id <> ?1 AND sku_id=?2 AND price_list_id=?3 AND project_id=?4 AND version=?5", nativeQuery=true) @Caching(evict=@CacheEvict(cacheNames="prceListSkuCountCache",key="#p2+\'_\'+#p3+\'_\'+#p4")) void updateSkuStatus(long priceId, String skuId, long priceListId, long projectId, String version) - Parameters:
priceId
- Price IdentifierskuId
- sku identifierpriceListId
- pricelist identifierprojectId
- project identifierversion
- version
-