Last active
August 31, 2021 14:13
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
@Entity | |
@Builder | |
public class Employee { | |
@Id | |
@GeneratedValue | |
@Column(name = "EMPLOYEE_ID") | |
private Long id; | |
@Column | |
private String name; | |
@ManyToOne // 직원 : 기업 = N : 1 | |
@JoinColumn(name = "COMPANY_ID") // Foreign Key | |
private Company company; | |
} | |
@Entity | |
@Builder | |
public class Company { | |
@Id | |
@GeneratedValue | |
@Column(name = "COMPANY_ID") | |
private Long id; | |
private String name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment