Interface UniqueInventory<T extends UniqueInventoryItem>
- All Superinterfaces:
CrudRepository<T,,InventoryItem.InventoryItemIdentifier> Inventory<T>,PagingAndSortingRepository<T,,InventoryItem.InventoryItemIdentifier> Repository<T,,InventoryItem.InventoryItemIdentifier> SalespointRepository<T,InventoryItem.InventoryItemIdentifier>
public interface UniqueInventory<T extends UniqueInventoryItem>
extends Inventory<T>, SalespointRepository<T,InventoryItem.InventoryItemIdentifier>
A
UniqueInventory manages UniqueInventoryItems, i.e. only a single InventoryItem can exist
per Product. This simplifies the lookup of the quantity available for a given Product to the lookup
of a single UniqueInventoryItem.
Also, on Order completion, a UniqueInventoryItem can be updated and get its Quantity deducted
based on the quantity of products ordered.
- Since:
- 7.2
- Author:
- Oliver Drotbohm
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfindByProduct(Product product) Returns theInventoryItemfor the givenProduct.findByProductIdentifier(Product.ProductIdentifier productIdentifier) Returns theInventoryItemfor the givenProduct.ProductIdentifier.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.salespointframework.inventory.Inventory
findItemsOutOfStock, streamAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.salespointframework.core.SalespointRepository
findAll, findAll, findAllById, saveAll
-
Method Details
-
findByProductIdentifier
@Query("select i from #{#entityName} i\n where i.product.id = ?1\n") Optional<T> findByProductIdentifier(Product.ProductIdentifier productIdentifier) Returns theInventoryItemfor the givenProduct.ProductIdentifier.- Parameters:
productIdentifier- must not be null.- Returns:
-
findByProduct
Returns theInventoryItemfor the givenProduct.- Parameters:
product- must not be null.- Returns:
-