[ 
https://issues.apache.org/jira/browse/OPENJPA-2728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Struberg updated OPENJPA-2728:
-----------------------------------
    Fix Version/s:     (was: 3.0.0)
                   3.0.1
                   3.0.1

> Metamodel generation of entity or mapped superclass
> ---------------------------------------------------
>
>                 Key: OPENJPA-2728
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2728
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Karl Richter
>            Priority: Major
>             Fix For: 3.0.1
>
>
> A simple entity or mapped superclass with a generic type parameter causes the 
> metamodel generation to fail because of syntax errors, e.g.
> {code:java}
> @MappedSuperclass
> public abstract class MyEntity2<T extends MyEntity> implements Serializable {
>     private static final long serialVersionUID = 1L;
>     @Id
>     @GeneratedValue
>     private Long id;
>     private T myEntity;
> {code}
> causes the generation of
> {code:java}
> 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;
> }
> {code}
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to