backend stuff for ingredients and nutritions

This commit is contained in:
Aysegul Aydinlik 2025-12-04 14:41:45 +01:00
commit 88dc43613f
8 changed files with 296 additions and 0 deletions

View file

@ -0,0 +1,11 @@
package server;
import commons.Ingredient;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface IngredientRepository extends JpaRepository<Ingredient, Long> {
List<Ingredient> findAllByOrderByNameAsc();
}

View file

@ -0,0 +1,11 @@
package server;
import commons.RecipeIngredient;
import org.springframework.data.jpa.repository.JpaRepository;
public interface RecipeIngredientRepository extends JpaRepository<RecipeIngredient, Long> {
long countByIngredientId(long ingredientId);
void deleteByIngredientId(long ingredientId);
}