-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...ango/src/main/java/com/sundaegukbap/banchango/ingredient/domain/RecipeMainIngredient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.sundaegukbap.banchango.ingredient.domain; | ||
|
||
import com.sundaegukbap.banchango.recipe.domain.Recipe; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Table(name="recipe_main_ingredients") | ||
public class RecipeMainIngredient { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name="recipe_id") | ||
private Recipe recipe; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name="ingredient_id") | ||
private Ingredient ingredient; | ||
|
||
@Builder | ||
public RecipeMainIngredient(Long id, Recipe recipe, Ingredient ingredient) { | ||
this.id = id; | ||
this.recipe = recipe; | ||
this.ingredient = ingredient; | ||
} | ||
} |