org.broadleafcommerce.inventory.dao
Class InventoryDaoImpl

java.lang.Object
  extended by org.broadleafcommerce.inventory.dao.InventoryDaoImpl
All Implemented Interfaces:
InventoryDao

@Repository(value="blInventoryDao")
public class InventoryDaoImpl
extends Object
implements InventoryDao


Field Summary
protected  javax.persistence.EntityManager em
           
 
Constructor Summary
InventoryDaoImpl()
           
 
Method Summary
 void delete(Inventory inventory)
          Deletes the Inventory
 Inventory readById(Long id)
           
 Inventory readForUpdateById(Long id)
          Same as read, but refreshes and handles locking for concurrent updates
 Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku, FulfillmentLocation fulfillmentLocation)
          Retrieves the Inventory for the given Sku and FulfillmentLocation
 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
 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.
 List<org.broadleafcommerce.core.catalog.domain.Sku> readSkusNotAtFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
          Retrieves skus that do not have inventory records at a particular fulfillment location
 Inventory save(Inventory inventory)
          Persists the Inventory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

em

protected javax.persistence.EntityManager em
Constructor Detail

InventoryDaoImpl

public InventoryDaoImpl()
Method Detail

save

public Inventory save(Inventory inventory)
               throws ConcurrentInventoryModificationException
Description copied from interface: InventoryDao
Persists the Inventory

Specified by:
save in interface InventoryDao
Parameters:
inventory - Inventory
Returns:
the persisted Inventory
Throws:
ConcurrentInventoryModificationException

readInventory

public Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku,
                               FulfillmentLocation fulfillmentLocation)
Description copied from interface: InventoryDao
Retrieves the Inventory for the given Sku and FulfillmentLocation

Specified by:
readInventory in interface InventoryDao
Parameters:
sku - Sku
fulfillmentLocation - FulfillmentLocation
Returns:
Inventory

readInventoryForUpdate

public Inventory readInventoryForUpdate(org.broadleafcommerce.core.catalog.domain.Sku sku,
                                        FulfillmentLocation fulfillmentLocation)
                                 throws ConcurrentInventoryModificationException
Description copied from interface: InventoryDao
Same as readInventory but refreshes and locks the object.

Specified by:
readInventoryForUpdate in interface InventoryDao
Returns:
Throws:
ConcurrentInventoryModificationException

readInventoryForDefaultFulfillmentLocation

public Inventory readInventoryForDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku)
Description copied from interface: InventoryDao
Retrieves the Inventory for the given Sku

Specified by:
readInventoryForDefaultFulfillmentLocation in interface InventoryDao
Parameters:
sku - Sku
Returns:
List

readInventoryForUpdateForDefaultFulfillmentLocation

public Inventory readInventoryForUpdateForDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku)
                                                              throws ConcurrentInventoryModificationException
Description copied from interface: InventoryDao
Same as readInventoryForDefaultFulfillmentLocation but refreshes and locks the object.

Specified by:
readInventoryForUpdateForDefaultFulfillmentLocation in interface InventoryDao
Returns:
Throws:
ConcurrentInventoryModificationException

delete

public void delete(Inventory inventory)
Description copied from interface: InventoryDao
Deletes the Inventory

Specified by:
delete in interface InventoryDao

readById

public Inventory readById(Long id)
Specified by:
readById in interface InventoryDao

readForUpdateById

public Inventory readForUpdateById(Long id)
                            throws ConcurrentInventoryModificationException
Description copied from interface: InventoryDao
Same as read, but refreshes and handles locking for concurrent updates

Specified by:
readForUpdateById in interface InventoryDao
Returns:
Throws:
ConcurrentInventoryModificationException

readInventoryForFulfillmentLocation

public List<Inventory> readInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Description copied from interface: InventoryDao
Retrieves all instances of Inventory for this fulfillmentLocation

Specified by:
readInventoryForFulfillmentLocation in interface InventoryDao
Returns:
list of Inventory

readSkusNotAtFulfillmentLocation

public List<org.broadleafcommerce.core.catalog.domain.Sku> readSkusNotAtFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Description copied from interface: InventoryDao
Retrieves skus that do not have inventory records at a particular fulfillment location

Specified by:
readSkusNotAtFulfillmentLocation in interface InventoryDao
Returns:


Copyright © 2013. All Rights Reserved.