You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "Steiner, Matthias" <ma...@sap.com> on 2014/10/28 15:28:53 UTC

JPA Model with 1:n relationships backed by java.uil.List

Hi all,

I have a simple JPA model with a 1:n association between a Contact and Address as follows:

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name="CONTACT_ID", referencedColumnName="ID")
@Valid
protected List<Address> addresses = null;

When exposing my JPA model as Odata via Oling o(v2) I get the following error message:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en">
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.
</message>
</error>

Needless to say the error message is somewhat wrong… when searching for support of java.uil.List in Olingo v2 it sounded like it would be possible.

Any idea what I’m doing wrong here?

BR,
matthias

Re: JPA Model with 1:n relationships backed by java.uil.List

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Chandan,

thanks for clarification.

Kind regards,
Michael

On 29 Oct 2014, at 06:02, V.A, Chandan <ch...@sap.com> wrote:

> Hi Michael,
> The Olingo JPA Processor reference library uses 2.0.5 version of javax.persistence and the use case works.
> 
> Thanks
> Kind Regards
> Chandan
> 
> -----Original Message-----
> From: mibo [mailto:mibo.asap@gmail.com] 
> Sent: Wednesday, October 29, 2014 12:00 AM
> To: user@olingo.apache.org
> Subject: Re: JPA Model with 1:n relationships backed by java.uil.List
> 
> Hello Matthias,
> 
> thanks a lot for your feedback and investigation.
> Currently we use version "2.0.5" of "javax.persistence" and I will check if it works with this version either.
> 
> Kind regards,
> Michael
> 
>> Am 28.10.2014 um 18:03 schrieb Steiner, Matthias <ma...@sap.com>:
>> 
>> FYI - updated my Maven pom to use version 2.1.0 instead of 2.0.3 of the 'javax.persistence' lib and it works now:
>> 
>> <dependency>
>> <groupId>org.eclipse.persistence</groupId>
>> <artifactId>javax.persistence</artifactId>
>> <version>2.1.0</version>
>> </dependency>
>> 
>> Cheers,
>> matthias
>> 
>> 
>> From: <Steiner>, Matthias Steiner <ma...@sap.com>
>> Date: Dienstag, 28. Oktober 2014 15:28
>> To: "user@olingo.apache.org" <us...@olingo.apache.org>
>> Subject: JPA Model with 1:n relationships backed by java.uil.List
>> 
>> Hi all,
>> 
>> I have a simple JPA model with a 1:n association between a Contact and Address as follows:
>> 
>> @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
>> @JoinColumn(name="CONTACT_ID", referencedColumnName="ID")
>> @Valid
>> protected List<Address> addresses = null;
>> 
>> When exposing my JPA model as Odata via Oling o(v2) I get the following error message:
>> 
>> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
>> <code/>
>> <message xml:lang="en">
>> 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.
>> </message>
>> </error>
>> 
>> Needless to say the error message is somewhat wrong... when searching for support of java.uil.List in Olingo v2 it sounded like it would be possible.
>> 
>> Any idea what I'm doing wrong here?
>> 
>> BR,
>> matthias
> 


RE: JPA Model with 1:n relationships backed by java.uil.List

Posted by "V.A, Chandan" <ch...@sap.com>.
Hi Michael,
The Olingo JPA Processor reference library uses 2.0.5 version of javax.persistence and the use case works.

Thanks
Kind Regards
Chandan

-----Original Message-----
From: mibo [mailto:mibo.asap@gmail.com] 
Sent: Wednesday, October 29, 2014 12:00 AM
To: user@olingo.apache.org
Subject: Re: JPA Model with 1:n relationships backed by java.uil.List

Hello Matthias,

thanks a lot for your feedback and investigation.
Currently we use version "2.0.5" of "javax.persistence" and I will check if it works with this version either.

Kind regards,
Michael

> Am 28.10.2014 um 18:03 schrieb Steiner, Matthias <ma...@sap.com>:
> 
> FYI - updated my Maven pom to use version 2.1.0 instead of 2.0.3 of the 'javax.persistence' lib and it works now:
> 
> <dependency>
> <groupId>org.eclipse.persistence</groupId>
> <artifactId>javax.persistence</artifactId>
> <version>2.1.0</version>
> </dependency>
> 
> Cheers,
> matthias
> 
> 
> From: <Steiner>, Matthias Steiner <ma...@sap.com>
> Date: Dienstag, 28. Oktober 2014 15:28
> To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Subject: JPA Model with 1:n relationships backed by java.uil.List
> 
> Hi all,
> 
> I have a simple JPA model with a 1:n association between a Contact and Address as follows:
> 
> @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
> @JoinColumn(name="CONTACT_ID", referencedColumnName="ID")
> @Valid
> protected List<Address> addresses = null;
> 
> When exposing my JPA model as Odata via Oling o(v2) I get the following error message:
> 
> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
> <code/>
> <message xml:lang="en">
> 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.
> </message>
> </error>
> 
> Needless to say the error message is somewhat wrong... when searching for support of java.uil.List in Olingo v2 it sounded like it would be possible.
> 
> Any idea what I'm doing wrong here?
> 
> BR,
> matthias


Re: JPA Model with 1:n relationships backed by java.uil.List

Posted by mibo <mi...@gmail.com>.
Hello Matthias,

thanks a lot for your feedback and investigation.
Currently we use version "2.0.5" of "javax.persistence" and I will check if it works with this version either.

Kind regards,
Michael

> Am 28.10.2014 um 18:03 schrieb Steiner, Matthias <ma...@sap.com>:
> 
> FYI - updated my Maven pom to use version 2.1.0 instead of 2.0.3 of the 'javax.persistence' lib and it works now:
> 
> <dependency>
> <groupId>org.eclipse.persistence</groupId>
> <artifactId>javax.persistence</artifactId>
> <version>2.1.0</version>
> </dependency>
> 
> Cheers,
> matthias
> 
> 
> From: <Steiner>, Matthias Steiner <ma...@sap.com>
> Date: Dienstag, 28. Oktober 2014 15:28
> To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Subject: JPA Model with 1:n relationships backed by java.uil.List
> 
> Hi all,
> 
> I have a simple JPA model with a 1:n association between a Contact and Address as follows:
> 
> @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
> @JoinColumn(name="CONTACT_ID", referencedColumnName="ID")
> @Valid
> protected List<Address> addresses = null;
> 
> When exposing my JPA model as Odata via Oling o(v2) I get the following error message:
> 
> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
> <code/>
> <message xml:lang="en">
> 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.
> </message>
> </error>
> 
> Needless to say the error message is somewhat wrong… when searching for support of java.uil.List in Olingo v2 it sounded like it would be possible.
> 
> Any idea what I’m doing wrong here?
> 
> BR,
> matthias


Re: JPA Model with 1:n relationships backed by java.uil.List

Posted by "Steiner, Matthias" <ma...@sap.com>.
FYI - updated my Maven pom to use version 2.1.0 instead of 2.0.3 of the 'javax.persistence' lib and it works now:


<dependency>

<groupId>org.eclipse.persistence</groupId>

<artifactId>javax.persistence</artifactId>

<version>2.1.0</version>

</dependency>


Cheers,

matthias


From: <Steiner>, Matthias Steiner <ma...@sap.com>>
Date: Dienstag, 28. Oktober 2014 15:28
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: JPA Model with 1:n relationships backed by java.uil.List

Hi all,

I have a simple JPA model with a 1:n association between a Contact and Address as follows:

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name="CONTACT_ID", referencedColumnName="ID")
@Valid
protected List<Address> addresses = null;

When exposing my JPA model as Odata via Oling o(v2) I get the following error message:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en">
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.
</message>
</error>

Needless to say the error message is somewhat wrong… when searching for support of java.uil.List in Olingo v2 it sounded like it would be possible.

Any idea what I’m doing wrong here?

BR,
matthias