gruppen und likes fertig
This commit is contained in:
parent
fdd18bdb6c
commit
fce585e089
@ -4,7 +4,7 @@ import java.time.LocalDateTime;
|
|||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "`like`")
|
@Table(name = "`likes`")
|
||||||
public class Like {
|
public class Like {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@ -11,6 +11,7 @@ public interface RecipeRepository extends JpaRepository<Recipe, Long> {
|
|||||||
Page<Recipe> findByCategoryIgnoreCase(String category, Pageable pageable);
|
Page<Recipe> findByCategoryIgnoreCase(String category, Pageable pageable);
|
||||||
|
|
||||||
// Sucht nach Rezepten, die eine bestimmte Zutat enthalten
|
// Sucht nach Rezepten, die eine bestimmte Zutat enthalten
|
||||||
@Query("SELECT r FROM Recipe r JOIN r.recipeIngredients i WHERE LOWER(i.name) LIKE LOWER(CONCAT('%', :ingredient, '%'))")
|
@Query("SELECT r FROM Recipe r JOIN r.recipeIngredients i WHERE LOWER(i.ingredient.name) LIKE LOWER(CONCAT('%', :ingredient, '%'))")
|
||||||
Page<Recipe> findByIngredient(@Param("ingredient") String ingredient, Pageable pageable);
|
Page<Recipe> findByIngredient(@Param("ingredient") String ingredient, Pageable pageable);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@ spring.datasource.username=root
|
|||||||
spring.datasource.password=
|
spring.datasource.password=
|
||||||
|
|
||||||
# Hibernate Einstellungen
|
# Hibernate Einstellungen
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
|
||||||
spring.jpa.show-sql=true
|
spring.jpa.show-sql=true
|
||||||
|
spring.jpa.properties.hibernate.format_sql=true
|
||||||
|
spring.jpa.properties.hibernate.use_sql_comments=true
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user