package app.mealsmadeeasy.api.recipe.comment; import app.mealsmadeeasy.api.recipe.Recipe; import app.mealsmadeeasy.api.user.User; import jakarta.persistence.*; import lombok.Data; import java.time.OffsetDateTime; @Entity @Table(name = "recipe_comment") @Data public final class RecipeComment { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(nullable = false) private Integer id; @Column(nullable = false, updatable = false) private OffsetDateTime created = OffsetDateTime.now(); private OffsetDateTime modified; @Lob @Basic(fetch = FetchType.LAZY) private String rawText; @Lob @Basic(fetch = FetchType.LAZY) private String cachedRenderedText; @ManyToOne @JoinColumn(name = "owner_id", nullable = false, updatable = false) private User owner; @ManyToOne @JoinColumn(name = "recipe_id", nullable = false, updatable = false) private Recipe recipe; }