fixed todo delete progatation in recipe
added count to IngredientController about what recipes we have or dont and 2 small typo mistakes also added counting ingredients to IngredientService
This commit is contained in:
parent
de8bdd60db
commit
16c8d4c6dc
3 changed files with 43 additions and 14 deletions
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package commons;
|
||||
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.CollectionTable;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
|
|
@ -60,7 +61,7 @@ public class Recipe {
|
|||
// | 1 (Steak) | 40g pepper |
|
||||
// | 1 (Steak) | Meat |
|
||||
// |----------------------------------|
|
||||
@OneToMany
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@CollectionTable(name = "recipe_ingredients", joinColumns = @JoinColumn(name = "recipe_id"))
|
||||
@Column(name = "ingredient")
|
||||
// TODO: Replace String with Embeddable Ingredient Class
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue