@AttributeOverride ignored with @Embedded [message #1007091] |
Mon, 04 February 2013 12:13 |
Emanuele Gesuato Messages: 12 Registered: December 2012 |
Junior Member |
|
|
Hi there,
we are using eclipse link 2.4 and we are having some issues on @AttributeOverride that seems to be ignored when we are referring to an @Embedded reference.
Here our scenario:
Person person
|-- Address myAddress
|-- Address secondaryAddress
where:
Address
|-- Zip myZip
|-- Zip mySecondaryZip
|-- String name
Zip
|-- Country myCountry
|-- String zipCode
Country
|-- String description
Address, Zip and Country classes are declared as @Embeddable(). Person is an @Entity.
myAddress has the following JPA annotations:
@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;
Using eclipseLink and postgresql the columns:
myaddress_myzip_zipcode
myaddress_myzip_mycountry_description
are not created in person table. The others are correctly created. We are using JPA 2.0 and postgresql 9.2. Why does it happen ? Am I missing something obvious ?
Is there a problem with a three level-nested path ?
Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.03199 seconds