Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2728

Metamodel generation of entity or mapped superclass

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 3.2.3
    • None
    • None

    Description

      A simple entity or mapped superclass with a generic type parameter causes the metamodel generation to fail because of syntax errors, e.g.

      @MappedSuperclass
      public abstract class MyEntity2<T extends MyEntity> implements Serializable {
          private static final long serialVersionUID = 1L;
          @Id
          @GeneratedValue
          private Long id;
          private T myEntity;
      

      causes the generation of

      import java.lang.Long;
      import javax.persistence.metamodel.SingularAttribute;
      
      @javax.persistence.metamodel.StaticMetamodel
      (value=richtercloud.openjpa.generic.metamodel.MyEntity2.class)
      @javax.annotation.Generated
      (value="org.apache.openjpa.persistence.meta.AnnotationProcessor6",date="Sat Feb 03 20:59:32 CET 2018")
      public class MyEntity2_ {
          public static volatile SingularAttribute<MyEntity2,Long> id;
          public static volatile SingularAttribute<MyEntity2,T> myEntity;
      }
      

      which is invalid because `T` isn't specified and thus unknown to the compiler.

      A SSCCE is provided at https://gitlab.com/krichter/openjpa-generic-metamodel.

      experienced with 3.0.0-SNAPSHOT

      Attachments

        Activity

          People

            Unassigned Unassigned
            krichter Karl-Philipp Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: