Skip to content

Commit

Permalink
feat : recipe 주재료 엔티티 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Due-IT committed Sep 26, 2024
1 parent 873edf0 commit b625355
Showing 1 changed file with 38 additions and 0 deletions.
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;
}
}

0 comments on commit b625355

Please sign in to comment.