1. jpa-spec
  2. JPA_SPEC-23

add a prefixing mechanism for @Embedded


    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:


      Currently working with @Embedded is not really user friendly. If you have multiple Embedded fields in an Entity, then you need to excessively use @AttributeOverrides to use them. This is not only a real nightmare to write down, but also an absolute pain when it comes to refactoring or if you just add or remove a column.

      It gets even worse if you have a nested @Embedded structure!

      The solution could be to allow specifying a 'prefix' as JDO knows it for years.

      Let's first look at the Embeddable

      public class Address {
        private String name1;
        private String name2;
        private String street1;
        private String street2;
        private String zip;
        private String tel;
        // ... + getters and setters

      (please let's not argue about whether this should better be stored 1:n but just take it as sample for now)

      Then we look at a possible solution with the prefix:

      public class Customer {
        private Address serviceAddress;
        private Address billingAddress;
        private Address physicalAddress;

      You all know what pain it is to do the same in JPA right now ...


        Mark Struberg created issue -
        ldemichiel made changes -
        Field Original Value New Value
        Assignee ldemichiel [ ldemichiel ]
        ldemichiel made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Tags RFE


          • Assignee:
            Mark Struberg
          • Votes:
            2 Vote for this issue
            2 Start watching this issue


            • Created: