[jira] [Resolved] (OLINGO-1146) CLONE - Cannot Filter on Navigation Property

2017-09-23 Thread Michael Bolz (JIRA)

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

Michael Bolz resolved OLINGO-1146.
--
   Resolution: Fixed
Fix Version/s: (was: V2 2.0.8)
   V2 2.0.10

> CLONE - Cannot Filter on Navigation Property
> 
>
> Key: OLINGO-1146
> URL: https://issues.apache.org/jira/browse/OLINGO-1146
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.0
>Reporter: igor nemtsov
>Assignee: Michael Bolz
> Fix For: V2 2.0.10
>
> Attachments: olingo-414-exception.diff, olingo-414-patch.diff, 
> olingo-odata2-parent.patch
>
>
> We are receiving an error when we try to filter on a navigation property.  In 
> our solution we have a Notification entity and a User entity, we would like 
> to retrieve a specific Notification but only if it is linked to the 
> requesting user.  This would involve an ODATA request which filters on both 
> the UserId and the NotificationId.  An example of the URL we are invoking is:
> dspplatform.svc/Notifications?$filter=NotificationId%20eq%204%20and%20UserDetails/UserId%20eq%202
> This returns the following error:
> org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv 
> cannot be cast to org.apache.olingo.odata2.api.edm.EdmProperty
> Can you please advise on how to perform filters on a Navigation property as 
> we need this as part of our core functionality?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OLINGO-1146) CLONE - Cannot Filter on Navigation Property

2017-09-23 Thread Michael Bolz (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16177948#comment-16177948
 ] 

Michael Bolz commented on OLINGO-1146:
--

Hi all,

I changed the filter parsing that only the last property is checked regarding 
invalid multiplicity (see [this 
commit|https://git-wip-us.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=6ce2421a5d7ebb40d6456d12f38913f725e87457]).

Accordingly the filter on navigation now works again (however I have to admit 
that for the JPA extension we need a lot more tests).

For the case that filter on navigation property still do not work, please 
reopen and give detailed feedback.

Regards, Michael

> CLONE - Cannot Filter on Navigation Property
> 
>
> Key: OLINGO-1146
> URL: https://issues.apache.org/jira/browse/OLINGO-1146
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.0
>Reporter: igor nemtsov
>Assignee: Michael Bolz
> Fix For: V2 2.0.10
>
> Attachments: olingo-414-exception.diff, olingo-414-patch.diff, 
> olingo-odata2-parent.patch
>
>
> We are receiving an error when we try to filter on a navigation property.  In 
> our solution we have a Notification entity and a User entity, we would like 
> to retrieve a specific Notification but only if it is linked to the 
> requesting user.  This would involve an ODATA request which filters on both 
> the UserId and the NotificationId.  An example of the URL we are invoking is:
> dspplatform.svc/Notifications?$filter=NotificationId%20eq%204%20and%20UserDetails/UserId%20eq%202
> This returns the following error:
> org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv 
> cannot be cast to org.apache.olingo.odata2.api.edm.EdmProperty
> Can you please advise on how to perform filters on a Navigation property as 
> we need this as part of our core functionality?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OLINGO-1146) CLONE - Cannot Filter on Navigation Property

2017-09-23 Thread Michael Bolz (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16177790#comment-16177790
 ] 

Michael Bolz commented on OLINGO-1146:
--

The problem seems to be a to strict check in filter parsing:
{{org/apache/olingo/odata2/core/uri/expression/FilterParserImpl.java:509}}

When the new code for to many check is commented out all works as before:
{code}
  if (edmProperty != null) {
property.setEdmProperty(edmProperty);
property.setEdmType(edmProperty.getType());
//if (edmProperty.getMultiplicity() == EdmMultiplicity.MANY) {
//  throw new ExpressionParserException(
//  ExpressionParserException.INVALID_MULTIPLICITY.create()
//  .addContent(propertyName)
//  .addContent(propertyToken.getPosition() + 1));
//}
  } else {
{code}

Currently I guess the filter must be adapted that only the last part of a 
filter literal is checked for multiplicity (e.g. "delivered" of 
"SalesOrderLineItemDetails/delivered eq true").

But this must be checked.

Regards, Michael

> CLONE - Cannot Filter on Navigation Property
> 
>
> Key: OLINGO-1146
> URL: https://issues.apache.org/jira/browse/OLINGO-1146
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.0
>Reporter: igor nemtsov
>Assignee: Michael Bolz
> Fix For: V2 2.0.8
>
> Attachments: olingo-414-exception.diff, olingo-414-patch.diff, 
> olingo-odata2-parent.patch
>
>
> We are receiving an error when we try to filter on a navigation property.  In 
> our solution we have a Notification entity and a User entity, we would like 
> to retrieve a specific Notification but only if it is linked to the 
> requesting user.  This would involve an ODATA request which filters on both 
> the UserId and the NotificationId.  An example of the URL we are invoking is:
> dspplatform.svc/Notifications?$filter=NotificationId%20eq%204%20and%20UserDetails/UserId%20eq%202
> This returns the following error:
> org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv 
> cannot be cast to org.apache.olingo.odata2.api.edm.EdmProperty
> Can you please advise on how to perform filters on a Navigation property as 
> we need this as part of our core functionality?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OLINGO-1146) CLONE - Cannot Filter on Navigation Property

2017-09-23 Thread Michael Bolz (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16177783#comment-16177783
 ] 

Michael Bolz commented on OLINGO-1146:
--

Hi all,

I just take a short look into this issue and it seems that there was a 
regression introduced.
Currently I guess during fix of OLINGO-1026.
At least with the fix for OLINGO-414 (commit {{07984dc1}}) it has worked.
(RefScenario with URL 
http://localhost:8080/SalesOrderProcessing.svc/SalesOrders?$filter=SalesOrderLineItemDetails/delivered%20eq%20true).

I will check and give feedback.

Regards, Michael

> CLONE - Cannot Filter on Navigation Property
> 
>
> Key: OLINGO-1146
> URL: https://issues.apache.org/jira/browse/OLINGO-1146
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.0
>Reporter: igor nemtsov
>Assignee: Michael Bolz
> Fix For: V2 2.0.8
>
> Attachments: olingo-414-exception.diff, olingo-414-patch.diff, 
> olingo-odata2-parent.patch
>
>
> We are receiving an error when we try to filter on a navigation property.  In 
> our solution we have a Notification entity and a User entity, we would like 
> to retrieve a specific Notification but only if it is linked to the 
> requesting user.  This would involve an ODATA request which filters on both 
> the UserId and the NotificationId.  An example of the URL we are invoking is:
> dspplatform.svc/Notifications?$filter=NotificationId%20eq%204%20and%20UserDetails/UserId%20eq%202
> This returns the following error:
> org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv 
> cannot be cast to org.apache.olingo.odata2.api.edm.EdmProperty
> Can you please advise on how to perform filters on a Navigation property as 
> we need this as part of our core functionality?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OLINGO-1156) ODataJPAServiceFactory - Cannot create or update entry with ManyToOne association

2017-09-23 Thread Michael Bolz (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-1156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16177757#comment-16177757
 ] 

Michael Bolz edited comment on OLINGO-1156 at 9/23/17 12:03 PM:


Hi all,

Just for clarification.
You do a e.g. a POST request for "Alternative" wich includes "Scopes" (as 
expanded entity) wich should be also created. Correct?
Can you please also provide the sample request payload?

Regards, Michael


was (Author: mirbo):
Hi all,

Just for clarification.
You do a e.g. a POST request for "Atlernative" wich includes "Scopes" (as 
expanded entity) wich should be also created. Correct?
Can you please also provide the sample request payload?

Regards, Michael

> ODataJPAServiceFactory - Cannot create or update entry with ManyToOne 
> association
> -
>
> Key: OLINGO-1156
> URL: https://issues.apache.org/jira/browse/OLINGO-1156
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.9
> Environment: EclipseLink 2.5.2
>Reporter: Tilo Eilebrecht
>Assignee: Michael Bolz
>Priority: Blocker
> Attachments: Alternative.java, Scope.java
>
>
> My project uses ODataJPAServiceFactory as described in the tutorial for JPA. 
> I have an entity which references another entity with a ManyToOne 
> relationship. If I submit a create or change request, the reference 
> (idAlternative) is not created or updated. As the field is not nullable, 
> object creation fails altogether.
> See my Entities in the attachment. The JoinColumn is idAlternative. 
> I have investigated into possible causes and I stumbled on 
> org.apache.olingo.odata2.jpa.processor.core.access.dataJPAEntity, method 
> write. This method identifies idAlternative as an embeddable key and removes 
> it from the propertyNames set. Therefore it does not get written into the 
> object.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OLINGO-1156) ODataJPAServiceFactory - Cannot create or update entry with ManyToOne association

2017-09-23 Thread Michael Bolz (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-1156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16177757#comment-16177757
 ] 

Michael Bolz commented on OLINGO-1156:
--

Hi all,

Just for clarification.
You do a e.g. a POST request for "Atlernative" wich includes "Scopes" (as 
expanded entity) wich should be also created. Correct?
Can you please also provide the sample request payload?

Regards, Michael

> ODataJPAServiceFactory - Cannot create or update entry with ManyToOne 
> association
> -
>
> Key: OLINGO-1156
> URL: https://issues.apache.org/jira/browse/OLINGO-1156
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.9
> Environment: EclipseLink 2.5.2
>Reporter: Tilo Eilebrecht
>Assignee: Michael Bolz
>Priority: Blocker
> Attachments: Alternative.java, Scope.java
>
>
> My project uses ODataJPAServiceFactory as described in the tutorial for JPA. 
> I have an entity which references another entity with a ManyToOne 
> relationship. If I submit a create or change request, the reference 
> (idAlternative) is not created or updated. As the field is not nullable, 
> object creation fails altogether.
> See my Entities in the attachment. The JoinColumn is idAlternative. 
> I have investigated into possible causes and I stumbled on 
> org.apache.olingo.odata2.jpa.processor.core.access.dataJPAEntity, method 
> write. This method identifies idAlternative as an embeddable key and removes 
> it from the propertyNames set. Therefore it does not get written into the 
> object.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (OLINGO-1156) ODataJPAServiceFactory - Cannot create or update entry with ManyToOne association

2017-09-23 Thread Michael Bolz (JIRA)

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

Michael Bolz reassigned OLINGO-1156:


Assignee: Michael Bolz

> ODataJPAServiceFactory - Cannot create or update entry with ManyToOne 
> association
> -
>
> Key: OLINGO-1156
> URL: https://issues.apache.org/jira/browse/OLINGO-1156
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.9
> Environment: EclipseLink 2.5.2
>Reporter: Tilo Eilebrecht
>Assignee: Michael Bolz
>Priority: Blocker
> Attachments: Alternative.java, Scope.java
>
>
> My project uses ODataJPAServiceFactory as described in the tutorial for JPA. 
> I have an entity which references another entity with a ManyToOne 
> relationship. If I submit a create or change request, the reference 
> (idAlternative) is not created or updated. As the field is not nullable, 
> object creation fails altogether.
> See my Entities in the attachment. The JoinColumn is idAlternative. 
> I have investigated into possible causes and I stumbled on 
> org.apache.olingo.odata2.jpa.processor.core.access.dataJPAEntity, method 
> write. This method identifies idAlternative as an embeddable key and removes 
> it from the propertyNames set. Therefore it does not get written into the 
> object.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (OLINGO-752) Add support for "+" sign as a separator in addition to %20 for URLs

2017-09-23 Thread Michael Bolz (JIRA)

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

Michael Bolz closed OLINGO-752.
---

> Add support for "+" sign as a separator in addition to %20 for URLs
> ---
>
> Key: OLINGO-752
> URL: https://issues.apache.org/jira/browse/OLINGO-752
> Project: Olingo
>  Issue Type: New Feature
>  Components: odata2-core
>Affects Versions: V2 2.0.4, (Java) V4 4.0.0-beta-03
>Reporter: Ronny Bremer
>Priority: Minor
> Attachments: 0002-OLINGO-752-Treat-as-space-in-Decoder.patch
>
>
> Some well-known OData client libraries, such as JQuery, are using the 
> incorrect encoding for URLs sent to OLingo based OData v2 services.
> According to the OData V2 standard, the separator for encoded URLs is %20.
> However, in many cases when developers talk about "URL encoding", they use 
> Java functions like "URLEncoder.encode()" to encode the parameters for their 
> HTTP request. JQuery seems to utilise a similar function in JavaScript.
> Now these functions are based on the HTTP forms encoding standard, so they 
> use "+" as a separator.
> If would be small but grateful addition to the OLingo URI parser to accept 
> both separator characters. Maybe with a config option to follow the standard 
> (so only accept %20) or to be more relaxed (and accept both).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)