You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "Birenheide, Richard" <ri...@sap.com> on 2015/12/18 12:37:27 UTC

JPA FunctionImports choke on empty Collections

Hi,

when implementing a FunctionImport in the JPA model, I get an exception when returning an empty List for a collection of Complex Types. Is this intended behavior?

Thanks
Richard

Dr. Richard Birenheide
Development Architect
Suite Architecture
SAP SE
Dietmar-Hopp-Allee 16,
69190 Walldorf
Germany
T +49 / 6227 / 7-42303
F +49 / 6227 / 7835816
E richard.birenheide@sap.com
http://www.sap.com<http://www.sap.com/>
Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.


Re: JPA FunctionImports choke on empty Collections

Posted by mibo <mi...@apache.org>.
Hi Richard,


Sorry I misunderstood your issue.
IMHO the result for an empty list should be not a 404 Not Found (which is the default for returning „null“).
The service (your function import) should respond with an empty array (JSON) like http://services.odata.org/V2/(S(2cvtzoa11mwbi12ppaa2uxtt))/OData/OData.svc/GetProductsByRating?rating=1&$format=json



It would be nice if you could open a bug and add a short description at https://issues.apache.org/jira/browse/OLINGO


Best Regards,
Michael






> On Dec 18, 2015, at 3:00 PM, Birenheide, Richard <ri...@sap.com> wrote:
> 
> 
> Hi Michael
> 
> 
>  
> 
> 
> I get a 404 and the message below. I’d have expected to get an empty list…
> 
> 
>  
> 
> 
> Kind Regards
> 
> 
> Richard
> 
> 
>  
> 
> 
> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
> 
> 
> <code/>
> 
> 
> <message xml:lang="en-US">Common exception</message>
> 
> 
> </error>
> 
> 
>  
> 
> 
>  
> 
> 
> From:Bolz, Michael [mailto:michael.bolz@sap.com]
> Sent:Freitag, 18. Dezember 2015 14:39
> To:user@olingo.apache.org
> Subject:Re: JPA FunctionImports choke on empty Collections
> 
> 
> 
> 
> 
>  
> 
> * PGP - S/MIME Signed by an unverified key: 18.12.2015 at 14:38:49
> 
> 
> 
> Hi Richard,
> 
> 
> 
>  
> 
> 
> normally you should get a HTTP response with status code “404 Not Found” and an according odata error with a message like "Requested entity could not be found.”.
> 
> 
> 
> But for your described use case the error message seams to be not correct.
> 
> 
> 
> However the status code is ok (at least at my test case).
> 
> 
> 
> 
>  
> 
> 
> Can you please check what HTTP status code you get in the response?
> 
> 
> 
> 
>  
> 
> 
> Best Regards,
> 
> 
> 
> Michael
> 
> 
> 
> 
> 
>  
> 
> 
> 
>  
> 
>> On 18 Dec 2015, at 12:37, Birenheide, Richard <richard.birenheide@sap.com
>>> wrote:
>> 
>> 
>> 
>> 
>>  
>> 
>> Hi,
>> 
>> 
>> 
>>  
>> 
>> 
>> 
>> when implementing a FunctionImport in the JPA model, I get an exception when returning an empty List for a collection of Complex Types. Is this intended behavior?
>> 
>> 
>> 
>>  
>> 
>> 
>> 
>> Thanks
>> 
>> 
>> 
>> Richard
>> 
>> 
>> 
>>  
>> 
>> 
>> 
>> Dr. Richard Birenheide
>> Development Architect
>> Suite Architecture
>> SAP SE
>> Dietmar-Hopp-Allee 16,
>> 69190 Walldorf
>> Germany
>> T +49 / 6227 / 7-42303
>> F +49 / 6227 / 7835816
>> E richard.birenheide@sap.com
>> 
>> http://www.sap.com
>> 
>> 
>> 
>> 
>> Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx
>>  
>> Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
>> This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.
>> 
>> 
>> 
>> 
>> 
> 
>  
> 
> 
> 
> * D046871 <michael.bolz@sap.com
>>
> * Issuer: SAP-AG - Unverified
> 
> 
> 
>  
> 

RE: JPA FunctionImports choke on empty Collections

Posted by "Birenheide, Richard" <ri...@sap.com>.
Hi Michael

I get a 404 and the message below. I’d have expected to get an empty list…

Kind Regards
Richard

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en-US">Common exception</message>
</error>


From: Bolz, Michael [mailto:michael.bolz@sap.com]
Sent: Freitag, 18. Dezember 2015 14:39
To: user@olingo.apache.org
Subject: Re: JPA FunctionImports choke on empty Collections

* PGP - S/MIME Signed by an unverified key: 18.12.2015 at 14:38:49
Hi Richard,

normally you should get a HTTP response with status code “404 Not Found” and an according odata error with a message like "Requested entity could not be found.”.
But for your described use case the error message seams to be not correct.
However the status code is ok (at least at my test case).

Can you please check what HTTP status code you get in the response?

Best Regards,
Michael


On 18 Dec 2015, at 12:37, Birenheide, Richard <ri...@sap.com>> wrote:

Hi,

when implementing a FunctionImport in the JPA model, I get an exception when returning an empty List for a collection of Complex Types. Is this intended behavior?

Thanks
Richard

Dr. Richard Birenheide
Development Architect
Suite Architecture
SAP SE
Dietmar-Hopp-Allee 16,
69190 Walldorf
Germany
T +49 / 6227 / 7-42303
F +49 / 6227 / 7835816
E richard.birenheide@sap.com<ma...@sap.com>
http://www.sap.com<http://www.sap.com/>
Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.

* D046871 <mi...@sap.com>>
* Issuer: SAP-AG - Unverified


Re: JPA FunctionImports choke on empty Collections

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

normally you should get a HTTP response with status code “404 Not Found” and an according odata error with a message like "Requested entity could not be found.”.
But for your described use case the error message seams to be not correct.
However the status code is ok (at least at my test case).

Can you please check what HTTP status code you get in the response?

Best Regards,
Michael


> On 18 Dec 2015, at 12:37, Birenheide, Richard <ri...@sap.com> wrote:
> 
> Hi,
>  
> when implementing a FunctionImport in the JPA model, I get an exception when returning an empty List for a collection of Complex Types. Is this intended behavior?
>  
> Thanks
> Richard
>  
> Dr. Richard Birenheide
> Development Architect
> Suite Architecture
> SAP SE
> Dietmar-Hopp-Allee 16,
> 69190 Walldorf
> Germany
> T +49 / 6227 / 7-42303
> F +49 / 6227 / 7835816
> E richard.birenheide@sap.com <ma...@sap.com>
> http://www.sap.com <http://www.sap.com/>
> Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx <http://www.sap.com/company/legal/impressum.epx> 
> Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
> This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.