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 the StockLevelDao.
  • Constructor Details

    • DefaultStockLevelDao

      public DefaultStockLevelDao()
  • Method Details

    • findStockLevel

      public StockLevelModel findStockLevel(String productCode, WarehouseModel warehouse)
      Description copied from interface: StockLevelDao
      Finds the stock level of the specified product at the specified warehouse.
      Specified by:
      findStockLevel in interface StockLevelDao
      Parameters:
      productCode - the product code
      warehouse - warehouse of the product
      Returns:
      found stock level, and null if no such stock level can be found.
    • findAllStockLevels

      public Collection<StockLevelModel> findAllStockLevels(String productCode)
      Description copied from interface: StockLevelDao
      Finds the stock levels of the specified product from all warehouses.
      Specified by:
      findAllStockLevels in interface StockLevelDao
      Parameters:
      productCode - the product code
      Returns:
      all found stock levels of product
    • findStockLevels

      public Collection<StockLevelModel> findStockLevels(String productCode, Collection<WarehouseModel> warehouses)
      Description copied from interface: StockLevelDao
      Finds all stock levels of the specified product in the specified warehouses.
      Specified by:
      findStockLevels in interface StockLevelDao
      Parameters:
      productCode - the product code
      warehouses - the warehouses
      Returns:
      found stock levels of the product
    • findStockLevels

      public Collection<StockLevelModel> findStockLevels(String productCode, Collection<WarehouseModel> warehouses, int preOrderQuantity)
      Specified by:
      findStockLevels in interface StockLevelDao
    • getAvailableQuantity

      public Integer getAvailableQuantity(WarehouseModel warehouse, String productCode)
      Specified by:
      getAvailableQuantity in interface StockLevelDao
    • reserve

      public Integer reserve(StockLevelModel stockLevel, int amount)
      Description copied from interface: StockLevelDao
      Reserves the stock level with the amount. NOTE: direct database reservation with jdbc query must be used.
      Specified by:
      reserve in interface StockLevelDao
      Parameters:
      stockLevel - the stock level to be reserved
      amount - the amount of the reservation
      Returns:
      the actual stock level reserved amount after successful reservation, or NULL if reservation fails
    • release

      public Integer release(StockLevelModel stockLevel, int amount)
      Description copied from interface: StockLevelDao
      Releases the stock level with the amount. NOTE: direct database reservation with jdbc query must be used.
      Specified by:
      release in interface StockLevelDao
      Parameters:
      stockLevel - the stock level to be released
      amount - 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: StockLevelDao
      Updates the actual stock level with the actual amount. NOTE: direct database reservation with jdbc query must be used.
      Specified by:
      updateActualAmount in interface StockLevelDao
      Parameters:
      stockLevel - the stock level to be updated
      actualAmount - 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)