@OneToOne: 1개의 글
[JPA] @OneToOne, 1:1 관계 매핑
Table 관계도 Entity @Entity public class Person { @Id @GeneratedValue private int id; private String name; @OneToOne @JoinColumn(name = "cellular_id") private Cellular cellular; public Person() {} public Person(String name, Cellular cellular) { this.name = name; this.cellular = cellular; } // getter and setter @Override public String toString() { return "Person{" + "id=" + id + ", name='" + name + ..
Java 관련/JPA
2020. 9. 7. 12:47