public interface Inventory<T extends InventoryItem> extends SalespointRepository<T,InventoryItemIdentifier>
InventoryItem
s.Modifier and Type | Method and Description |
---|---|
default Optional<T> |
findByProduct(Product product)
Returns the
InventoryItem for the given Product . |
Optional<T> |
findByProductIdentifier(ProductIdentifier productIdentifier)
Returns the
InventoryItem for the Product with the given identifier. |
Iterable<T> |
findItemsOutOfStock()
Returns all
InventoryItem s that are out of stock (i.e. the Quantity 's amount is equal or less than
zero). |
@Query(value="select i from InventoryItem i where i.quantity.amount <= 0") Iterable<T> findItemsOutOfStock()
InventoryItem
s that are out of stock (i.e. the Quantity
's amount is equal or less than
zero).@Query(value="select i from InventoryItem i where i.product.id = ?1") Optional<T> findByProductIdentifier(ProductIdentifier productIdentifier)
InventoryItem
for the Product
with the given identifier.productIdentifier
- must not be null.default Optional<T> findByProduct(Product product)
InventoryItem
for the given Product
.product
- must not be null.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.