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

Michael Bolz updated OLINGO-526:
--------------------------------
    Description: 
Issue occurs with use of {{JPA Processor Extension}}.

If a uni-directional {{@OneToMany}} is used the creation of the {{metamodel}} 
fails with following exception:

{code}
java.lang.IllegalArgumentException
No [EntityType] was found for the key class [java.util.List] in the Metamodel - 
please verify that the [Entity] class was referenced in persistence.xml using a 
specific <class>java.util.List</class> property or a global 
<exclude-unlisted-classes>false</exclude-unlisted-classes> element.
{code}

in

{code}
org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl 
entityEmbeddableManagedTypeNotFound  173
org.apache.olingo.odata2.core.ep.AtomEntityProvider writeServiceDocument 157
{code}


Example code:
{code}
        @OneToMany
        @JoinColumn(name = "requestForQuotationUUID", referencedColumnName = 
"requestForQuotationUUID")
        private List<Quotation> quotation;
{code}


For {{JPA}} following dependencies are used:

{code}
<dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.5.1</version>
</dependency>
{code}
which transitive use {{org.eclipse.persistence:javax.persistence:jar:2.1.0}}.

  was:
Issue occurs with use of {{JPA Processor Extension}}.

If a uni-directional {{@OneToMany}} is used the creation of the {{metamodel}} 
fails with following exception:

{code}
java.lang.IllegalArgumentException
No [EntityType] was found for the key class [java.util.List] in the Metamodel - 
please verify that the [Entity] class was referenced in persistence.xml using a 
specific <class>java.util.List</class> property or a global 
<exclude-unlisted-classes>false</exclude-unlisted-classes> element.
{code}

in

{code}
org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl 
entityEmbeddableManagedTypeNotFound  173
org.apache.olingo.odata2.core.ep.AtomEntityProvider writeServiceDocument 157
{code}


Example code:
{code}
        @OneToMany
        @JoinColumn(name = "requestForQuotationUUID", referencedColumnName = 
"requestForQuotationUUID")
        private List<Quotation> quotation;
{code}


For {{JPA}} following dependencies are used:

{code}
                <dependency>
                        <groupId>org.eclipse.persistence</groupId>
                        <artifactId>eclipselink</artifactId>
                        <version>2.5.1</version>
                </dependency>
{code}


> Use of uni-directional @OneToMany leads to an exception
> -------------------------------------------------------
>
>                 Key: OLINGO-526
>                 URL: https://issues.apache.org/jira/browse/OLINGO-526
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.1
>            Reporter: Michael Bolz
>
> Issue occurs with use of {{JPA Processor Extension}}.
> If a uni-directional {{@OneToMany}} is used the creation of the {{metamodel}} 
> fails with following exception:
> {code}
> java.lang.IllegalArgumentException
> No [EntityType] was found for the key class [java.util.List] in the Metamodel 
> - please verify that the [Entity] class was referenced in persistence.xml 
> using a specific <class>java.util.List</class> property or a global 
> <exclude-unlisted-classes>false</exclude-unlisted-classes> element.
> {code}
> in
> {code}
> org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl 
> entityEmbeddableManagedTypeNotFound  173
> org.apache.olingo.odata2.core.ep.AtomEntityProvider writeServiceDocument 157
> {code}
> Example code:
> {code}
>       @OneToMany
>       @JoinColumn(name = "requestForQuotationUUID", referencedColumnName = 
> "requestForQuotationUUID")
>       private List<Quotation> quotation;
> {code}
> For {{JPA}} following dependencies are used:
> {code}
> <dependency>
>       <groupId>org.eclipse.persistence</groupId>
>       <artifactId>eclipselink</artifactId>
>       <version>2.5.1</version>
> </dependency>
> {code}
> which transitive use {{org.eclipse.persistence:javax.persistence:jar:2.1.0}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to