我有以下情况:
Person person
|-- 地址 myAddress
|-- 地址secondaryAddress
where:
Address
|-- Zip myZip
|-- Zip mySecondaryZip
|-- 字符串名称
Zip
|-- Country myCountry
|-- String zipCode
Country
|-- 字符串描述;
Address、Zip 和 Country 类被声明为 @Embeddable()。人是一个@Entity。
myAddress 具有以下 JPA 注释:
@Embedded()
@AttributeOverrides({ @AttributeOverride(column = @Column(name = "myaddress_name"), name = "name"),
@AttributeOverride(column = @Column(name = "myaddress_myzip_zipcode"), name = "myZip.zipCode"),
@AttributeOverride(column = @Column(name = "myaddress_myzip_mycountry_description"), name = "myZip.myCountry.description"),
@AttributeOverride(column = @Column(name = "myaddress_mysecondaryzip_zipcode"), name = "mySecondaryZip.zipCode"),
@AttributeOverride(column = @Column(name = "myaddress_mysecondaryzip_mycountry_description"), name = "mySecondaryZip.myCountry.description") })
private Address myAddress = null;
使用 eclipseLink 和 postgresql 作为 db 列:
myaddress_myzip_zipcode
myaddress_myzip_mycountry_description
不是在人员表中创建的。其他的都是正确创建的。我们正在使用 JPA 2.0 和 postgresql 9.2。为什么会这样?我错过了一些明显的东西吗?
谢谢