when I use the same embedded component several times in my entity (e.g. Addresses), I need to use @AttributeOverride for EACH field of the embedded component.
This is tedious when the entity is used several times and has a lot of fields.
And if you add a field to the embeddable component, you might forget to update all @AttributeOverrides.
Is there a simple method to define one single prefix for the fieldnames?
If not, should we raise a feature request for smth. like this:
@Entity public class Address { string country; string state; string street; ... } @Entity public class Male { @Embedded(prefix="wifesAddress_") Address wifesAddress; @Embedded(prefix="girlfriendsAddress_") Address girlfriendsAddress; .. }
Table: Male Columns: wifesAddress_country; wifesAddress_state; wifesAddress_street; girlfriendsAddress_country; girlfriendsAddress_state; girlfriendsAddress_street; ...
ups, the Address class should of course be annotated @Embeddable