Reputation:
I have such a Interface:
interface ItemRepository extends JpaRepository<Item, Integer> {
Item findItemByName(String name);
Collection<Item> findItemByCategory(String category);
}
it does the job without implementation already, but I have to add the following statement:
select from Item where quantity < 10;
Upvotes: 2
Views: 395
Reputation: 397
You can use LessThan
identifier or use a custom query like this :
@Query("SELECT i FROM Item i WHERE i.quantity < :quantity")
public List<Item> findByCategory(@Param("quantity") int quantity);
Upvotes: 0