有点愚蠢的问题,但我在任何地方都找不到答案。@Embeddable 对象如何存储在数据库中,是带 FK 的 OneToOne 还是...例如,如果我有:
@Entity
public class User {
private Long id;
@Id
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
private Address address;
@Embedded
public Address getAddress() { return address; }
public void setAddress() { this.address = address; }
}
@Embeddable
public class Address {
private String street1;
public String getStreet1() { return street1; }
public void setStreet1() { this.street1 = street1; }
}
表格应该是什么样子?