@Repository(value="blAdvancedInventoryDao") public class AdvancedInventoryDaoImpl extends Object implements AdvancedInventoryDao
| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
em |
protected FulfillmentTypeHelper |
fulfillmentTypeHelper |
protected org.broadleafcommerce.common.sandbox.SandBoxHelper |
sandBoxHelper |
| Constructor and Description |
|---|
AdvancedInventoryDaoImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Inventory inventory)
Deletes the
Inventory |
void |
deleteReservation(InventoryReservation reservation)
Deletes the reservation from the system
|
Inventory |
readById(Long id) |
Inventory |
readForUpdateById(Long id)
Same as read, but refreshes and handles locking for concurrent updates
|
List<Inventory> |
readInventoriesForUpdateFromSkus(Set<Long> skus,
FulfillmentLocation fulfillmentLocation) |
Inventory |
readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku,
FulfillmentLocation fulfillmentLocation)
|
List<Inventory> |
readInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
Returns all of the inventory records for the given sku within all {@link FulfillmentLocations
|
List<Inventory> |
readInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
org.broadleafcommerce.core.order.service.type.FulfillmentType fulfillmentType)
Returns all of the inventory records for the given sku at
FulfillmentLocations with the given
fulfillmentType |
int |
readInventoryCountAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
Reads a sum of all available quantities for a Sku across all fulfillment locations.
|
int |
readInventoryCountInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
Sums all of the
Inventory.getQuantityAvailable() for |
Inventory |
readInventoryForDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku)
Retrieves the
Inventory for the given Sku |
List<Inventory> |
readInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Retrieves all instances of Inventory for this fulfillmentLocation
|
List<Inventory> |
readInventoryForFulfillmentLocation(List<org.broadleafcommerce.core.catalog.domain.Sku> skus,
FulfillmentLocation fulfillmentLocation)
Reads inventories for a list of skus in the default fulfillment location.
|
Inventory |
readInventoryForUpdate(org.broadleafcommerce.core.catalog.domain.Sku sku,
FulfillmentLocation fulfillmentLocation)
Same as readInventory but refreshes and locks the object.
|
Inventory |
readInventoryForUpdateForDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku)
Same as readInventoryForDefaultFulfillmentLocation but refreshes and locks the object.
|
int |
readMaxInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
Gets the maximum quantity at a single fulfillment location for the given sku acros all locations
|
int |
readMaxInventoryInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
Gets the maximum quantity at a single fulfillment location for the given sku filtered by the given locations
|
Inventory |
save(Inventory inventory)
Persists the
Inventory |
InventoryReservation |
saveReservation(InventoryReservation reservation)
Saves the given reservation
|
protected FulfillmentTypeHelper fulfillmentTypeHelper
protected javax.persistence.EntityManager em
protected org.broadleafcommerce.common.sandbox.SandBoxHelper sandBoxHelper
public Inventory save(Inventory inventory) throws ConcurrentInventoryModificationException
AdvancedInventoryDaoInventorysave in interface AdvancedInventoryDaoinventory - InventoryInventoryConcurrentInventoryModificationExceptionpublic Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku, FulfillmentLocation fulfillmentLocation)
AdvancedInventoryDaoreadInventory in interface AdvancedInventoryDaosku - SkufulfillmentLocation - FulfillmentLocationInventorypublic Inventory readInventoryForUpdate(org.broadleafcommerce.core.catalog.domain.Sku sku, FulfillmentLocation fulfillmentLocation) throws ConcurrentInventoryModificationException
AdvancedInventoryDaoreadInventoryForUpdate in interface AdvancedInventoryDaoConcurrentInventoryModificationExceptionpublic List<Inventory> readInventoriesForUpdateFromSkus(Set<Long> skus, FulfillmentLocation fulfillmentLocation) throws ConcurrentInventoryModificationException
readInventoriesForUpdateFromSkus in interface AdvancedInventoryDaoConcurrentInventoryModificationExceptionpublic Inventory readInventoryForDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku)
AdvancedInventoryDaoInventory for the given SkureadInventoryForDefaultFulfillmentLocation in interface AdvancedInventoryDaosku - SkuListpublic Inventory readInventoryForUpdateForDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku) throws ConcurrentInventoryModificationException
AdvancedInventoryDaoreadInventoryForUpdateForDefaultFulfillmentLocation in interface AdvancedInventoryDaoConcurrentInventoryModificationExceptionpublic void delete(Inventory inventory)
AdvancedInventoryDaoInventorydelete in interface AdvancedInventoryDaopublic Inventory readById(Long id)
readById in interface AdvancedInventoryDaopublic Inventory readForUpdateById(Long id) throws ConcurrentInventoryModificationException
AdvancedInventoryDaoreadForUpdateById in interface AdvancedInventoryDaoConcurrentInventoryModificationExceptionpublic List<Inventory> readInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
AdvancedInventoryDaoreadInventoryForFulfillmentLocation in interface AdvancedInventoryDaoInventorypublic List<Inventory> readInventoryForFulfillmentLocation(List<org.broadleafcommerce.core.catalog.domain.Sku> skus, FulfillmentLocation fulfillmentLocation)
AdvancedInventoryDaoreadInventoryForFulfillmentLocation in interface AdvancedInventoryDaopublic int readInventoryCountAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
AdvancedInventoryDaoreadInventoryCountAcrossFulfillmentLocations in interface AdvancedInventoryDaopublic int readMaxInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
AdvancedInventoryDaoreadMaxInventoryAcrossFulfillmentLocations in interface AdvancedInventoryDaopublic int readInventoryCountInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
AdvancedInventoryDaoInventory.getQuantityAvailable() forreadInventoryCountInFulfillmentLocations in interface AdvancedInventoryDaopublic int readMaxInventoryInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
AdvancedInventoryDaoreadMaxInventoryInFulfillmentLocations in interface AdvancedInventoryDaopublic List<Inventory> readInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku, org.broadleafcommerce.core.order.service.type.FulfillmentType fulfillmentType)
AdvancedInventoryDaoFulfillmentLocations with the given
fulfillmentTypereadInventoryAcrossFulfillmentLocations in interface AdvancedInventoryDaosku - the {@link sfulfillmentType - the type of FulfillmentLocations to checkFulfillmentLocations filtered by the given fulfillmentTypeFulfillmentTypeHelper}public List<Inventory> readInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
AdvancedInventoryDaoreadInventoryAcrossFulfillmentLocations in interface AdvancedInventoryDaosku - the Sku to find inventory forFulfillmentLocationspublic InventoryReservation saveReservation(InventoryReservation reservation)
AdvancedInventoryDaosaveReservation in interface AdvancedInventoryDaoreservation - the entity to savepublic void deleteReservation(InventoryReservation reservation)
AdvancedInventoryDaodeleteReservation in interface AdvancedInventoryDaoreservation - the InventoryReservation to deleteCopyright © 2020. All rights reserved.