이창훈/spring/demo/src/main/java/kr/eddi/demo/entity/test/Comment.java
package kr.eddi.demo.entity.test;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Data
@Entity
@Builder
@AllArgsConstructor // builder쓰일때 꼭 같이 쓰임
@NoArgsConstructor
public class Comment {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String content;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "board_id")
    private TestBoard testBoard;

    public Comment (String content) {
        this.content = content;
    }

    public void modifyContent (String content) {
        this.content = content;
    }
}
