1 Reply Latest reply on Apr 4, 2008 6:15 AM by mars1412

    overriding of embedded field names

      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;
      
      ..
      
      }


      resulting in this database table:

      Table: Male
      Columns:
      wifesAddress_country;
      wifesAddress_state;
      wifesAddress_street;
      girlfriendsAddress_country;
      girlfriendsAddress_state;
      girlfriendsAddress_street;
      ...
      


      What do you think?