Package de.hybris.platform.stock.impl
Class DefaultStockLevelDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
-
- de.hybris.platform.stock.impl.DefaultStockLevelDao
-
- All Implemented Interfaces:
Dao,StockLevelDao
public class DefaultStockLevelDao extends AbstractItemDao implements StockLevelDao
Default implementation of theStockLevelDao.
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
flexibleSearchService, modelService
-
-
Constructor Summary
Constructors Constructor Description DefaultStockLevelDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<StockLevelModel>findAllStockLevels(java.lang.String productCode)Finds the stock levels of the specified product from all warehouses.StockLevelModelfindStockLevel(java.lang.String productCode, WarehouseModel warehouse)Finds the stock level of the specified product at the specified warehouse.java.util.Collection<StockLevelModel>findStockLevels(java.lang.String productCode, java.util.Collection<WarehouseModel> warehouses)Finds all stock levels of the specified product in the specified warehouses.java.util.Collection<StockLevelModel>findStockLevels(java.lang.String productCode, java.util.Collection<WarehouseModel> warehouses, int preOrderQuantity)java.lang.IntegergetAvailableQuantity(WarehouseModel warehouse, java.lang.String productCode)java.lang.Integerrelease(StockLevelModel stockLevel, int amount)Releases the stock level with the amount.java.lang.Integerreserve(StockLevelModel stockLevel, int amount)Reserves the stock level with the amount.voidsetJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)voidsetTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)voidsetTypeService(TypeService typeService)voidupdateActualAmount(StockLevelModel stockLevel, int actualAmount)Updates the actual stock level with the actual amount.-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
getAllSources, getFlexibleSearchService, getModelService, getSource, load, loadAll, search, search, searchUnique, setFlexibleSearchService, setModelService
-
-
-
-
Method Detail
-
findStockLevel
public StockLevelModel findStockLevel(java.lang.String productCode, WarehouseModel warehouse)
Description copied from interface:StockLevelDaoFinds the stock level of the specified product at the specified warehouse.- Specified by:
findStockLevelin interfaceStockLevelDao- Parameters:
productCode- the product codewarehouse- warehouse of the product- Returns:
- found stock level, and null if no such stock level can be found.
-
findAllStockLevels
public java.util.Collection<StockLevelModel> findAllStockLevels(java.lang.String productCode)
Description copied from interface:StockLevelDaoFinds the stock levels of the specified product from all warehouses.- Specified by:
findAllStockLevelsin interfaceStockLevelDao- Parameters:
productCode- the product code- Returns:
- all found stock levels of product
-
findStockLevels
public java.util.Collection<StockLevelModel> findStockLevels(java.lang.String productCode, java.util.Collection<WarehouseModel> warehouses)
Description copied from interface:StockLevelDaoFinds all stock levels of the specified product in the specified warehouses.- Specified by:
findStockLevelsin interfaceStockLevelDao- Parameters:
productCode- the product codewarehouses- the warehouses- Returns:
- found stock levels of the product
-
findStockLevels
public java.util.Collection<StockLevelModel> findStockLevels(java.lang.String productCode, java.util.Collection<WarehouseModel> warehouses, int preOrderQuantity)
- Specified by:
findStockLevelsin interfaceStockLevelDao
-
getAvailableQuantity
public java.lang.Integer getAvailableQuantity(WarehouseModel warehouse, java.lang.String productCode)
- Specified by:
getAvailableQuantityin interfaceStockLevelDao
-
reserve
public java.lang.Integer reserve(StockLevelModel stockLevel, int amount)
Description copied from interface:StockLevelDaoReserves the stock level with the amount. NOTE: direct database reservation with jdbc query must be used.- Specified by:
reservein interfaceStockLevelDao- Parameters:
stockLevel- the stock level to be reservedamount- the amount of the reservation- Returns:
- the actual stock level reserved amount after successful reservation, or NULL if reservation fails
-
release
public java.lang.Integer release(StockLevelModel stockLevel, int amount)
Description copied from interface:StockLevelDaoReleases the stock level with the amount. NOTE: direct database reservation with jdbc query must be used.- Specified by:
releasein interfaceStockLevelDao- Parameters:
stockLevel- the stock level to be releasedamount- the amount of the release- Returns:
- the actual stock level reserved amount after successful release, or NULL if release fails
-
updateActualAmount
public void updateActualAmount(StockLevelModel stockLevel, int actualAmount)
Description copied from interface:StockLevelDaoUpdates the actual stock level with the actual amount. NOTE: direct database reservation with jdbc query must be used.- Specified by:
updateActualAmountin interfaceStockLevelDao- Parameters:
stockLevel- the stock level to be updatedactualAmount- the actual amount of the stock level
-
setTypeService
public void setTypeService(TypeService typeService)
-
setTransactionTemplate
public void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
setJdbcTemplate
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
-
-