Interface MenuItemRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<MenuItem,Long>, CustomMenuItemRepository, org.springframework.data.repository.Repository<MenuItem, Long>
@Repository
public interface MenuItemRepository
extends org.springframework.data.repository.CrudRepository<MenuItem,Long>, CustomMenuItemRepository
-
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsById(Long id) findByDiningCommonsCodeAndMealCodeAndNameAndStation(String diningCommonsCode, String mealCode, String name, String station) This method returns a MenuItem entity with a given id.Finds all menu items whose name contains the given text, ignoring case, sorted by name.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, findAll, findAllById, findById, save, saveAllMethods inherited from interface CustomMenuItemRepository
findExistingEntrees
-
Method Details
-
findByDiningCommonsCodeAndMealCodeAndNameAndStation
Optional<MenuItem> findByDiningCommonsCodeAndMealCodeAndNameAndStation(String diningCommonsCode, String mealCode, String name, String station) This method returns a MenuItem entity with a given id.- Parameters:
diningCommonsCode- of menu itemmealCode- of menu itemname- of menu itemstation- of menu item- Returns:
- Optional of Menu item based on the parameters (empty if not found)
-
existsById
-
findByNameContainingIgnoreCaseOrderByNameAsc
Finds all menu items whose name contains the given text, ignoring case, sorted by name. Used by the menu item search box in the navbar.- Parameters:
name- text to look for anywhere in the item name (e.g. "stir" matches "Ginger Beef Stir Fry")- Returns:
- all matching menu items, sorted by name
-