package com.example.hangry; import jakarta.persistence.*; import java.util.List; @Entity public class Recipe { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String description; private String category; private String imageUrl; @OneToMany(mappedBy = "recipe", cascade = CascadeType.ALL, orphanRemoval = true) private List recipeIngredients; public Recipe() { } public Recipe(String name, String description, String category, String imageUrl) { this.name = name; this.description = description; this.category = category; this.imageUrl = imageUrl; } // Getter und Setter public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public String getImageUrl() { return imageUrl; } public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; } public List getRecipeIngredients() { return recipeIngredients; } public void setRecipeIngredients(List recipeIngredients) { this.recipeIngredients = recipeIngredients; } }