1 Reply Latest reply on Jan 29, 2014 8:42 AM by gastaldi

    Forge JPA entity with custom Id type

    rascio

      Hi,

      Is there a way to generate an entity with a custom class as id?

       

      Like:

      /**
       * Class that define the Id
       */
      @Embeddable
      public class Code implements Serializable{
          private Integer number;
          private Integer year;
      }
      
      /**
       * My entity class
       */
      @Entity
      public class Document{
      
          @EmbeddedId
          private Code code;
      }