Interface UniqueInventory<T extends UniqueInventoryItem>
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<T,InventoryItemIdentifier>,Inventory<T>,org.springframework.data.repository.Repository<T,InventoryItemIdentifier>
public interface UniqueInventory<T extends UniqueInventoryItem> extends Inventory<T>, org.springframework.data.repository.CrudRepository<T,InventoryItemIdentifier>
AUniqueInventorymanagesUniqueInventoryItems, i.e. only a singleInventoryItemcan exist perProduct. This simplifies the lookup of the quantity available for a givenProductto the lookup of a singleUniqueInventoryItem.Also, on
Ordercompletion, aUniqueInventoryItemcan be updated and get itsQuantitydeducted based on the quantity of products ordered.- Since:
- 7.2
- Author:
- Oliver Drotbohm
- See Also:
MultiInventoryItem
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Optional<T>findByProduct(Product product)Returns theInventoryItemfor the givenProduct.Optional<T>findByProductIdentifier(ProductIdentifier productIdentifier)Returns theInventoryItemfor the givenProductIdentifier.-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findAll, findAllById, findById, save, saveAll
-
Methods inherited from interface org.salespointframework.inventory.Inventory
findItemsOutOfStock
-
-
-
-
Method Detail
-
findByProductIdentifier
@Query("select i from #{#entityName} i where i.product.id = ?1") Optional<T> findByProductIdentifier(ProductIdentifier productIdentifier)Returns theInventoryItemfor the givenProductIdentifier.- Parameters:
productIdentifier- must not be null.- Returns:
-
findByProduct
default Optional<T> findByProduct(Product product)
Returns theInventoryItemfor the givenProduct.- Parameters:
product- must not be null.- Returns:
-
-