Interface MenuItemRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<MenuItem,
,Long> org.springframework.data.repository.Repository<MenuItem,
Long>
@Repository
public interface MenuItemRepository
extends org.springframework.data.repository.CrudRepository<MenuItem,Long>
Repository for MenuItem
-
Method Summary
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
-
Method Details
-
findByUniqueFields
@Query("SELECT m FROM menuitem m WHERE m.diningCommonsCode = :diningCommonsCode AND m.mealCode = :mealCode AND m.name = :name AND m.station = :station") Optional<MenuItem> findByUniqueFields(String diningCommonsCode, String mealCode, String name, String station) Finds a MenuItem by its unique combination of diningCommonsCode, mealCode, name, and station.- Parameters:
diningCommonsCode
- the code for the dining commonsmealCode
- the meal code (e.g., "breakfast", "lunch", "dinner")name
- the name of the menu itemstation
- the station where the item is served- Returns:
- an Optional containing the MenuItem if found, or empty otherwise
-