How do I use @AttributeOverride to changing the mapping when one component is nested inside another.
I have the following consisting of an entity and two embeddable classes, one of which is nested inside the other.
@Entity(access = AccessType.FIELD) public class PendingOrder { private Address deliveryAddress; private PaymentInformation paymentInformation; } @Embeddable(access = AccessType.FIELD) public class Address { private String street1; private String street2; .. } @Embeddable(access = AccessType.FIELD) public class PaymentInformation { protected String number; private Address address; }
@Embedded( { @AttributeOverride(name = "street1", column = { @Column(name = "DELIVERY_STREET1") }), @AttributeOverride(name = "street2", column = { @Column(name = "DELIVERY_STREET2") }), @AttributeOverride(name = "city", column = @Column(name = "DELIVERY_CITY")), @AttributeOverride(name = "state", column = @Column(name = "DELIVERY_STATE")), @AttributeOverride(name = "zip", column = @Column(name = "DELIVERY_ZIP")) }) private Address deliveryAddress;
This is not allowed by the spec :-( Please report to ejb3-edr2-feedback@sun.com if you need this feature.