2025-02-12 11:49:46 +01:00

82 lines
1.7 KiB
Java

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<RecipeIngredient> 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<RecipeIngredient> getRecipeIngredients() {
return recipeIngredients;
}
public void setRecipeIngredients(List<RecipeIngredient> recipeIngredients) {
this.recipeIngredients = recipeIngredients;
}
}