[jira] [Created] (OLINGO-829) Olingo JPA chokes on filter expression

2015-11-26 Thread Richard Birenheide (JIRA)
Richard Birenheide created OLINGO-829:
-

 Summary: Olingo JPA chokes on filter expression
 Key: OLINGO-829
 URL: https://issues.apache.org/jira/browse/OLINGO-829
 Project: Olingo
  Issue Type: Bug
  Components: odata2-jpa
Affects Versions: V2 2.0.6
 Environment: EclipseLink JPA provider
Reporter: Richard Birenheide


Olingo JPA chokes on the following filter expression:
$filter=startswith(ABAPReference,%27TEST%27)%20and%20(ABAPReferenceType%20eq%20%27DataElement%27)

with

class 
org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException : 
"org.apache.olingo.odata2.jpa.processor.core.ODataExpressionParser: "OData - 
JPA Runtime: OData Expression parser - Operator EQ or NE missing". "


whereas the following
$filter=(ABAPReferenceType%20eq%20%27DataElement%27)%20and%20startswith(ABAPReference,%27TEST%27)

works fine. Just the order of the 'and' expression parts is reversed. 
Unfortunately we use a frontend library which generates the expression 
automatically. 



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


[jira] [Created] (OLINGO-830) DefaultValue of a property not set in the map returned by ODataEntry.getProperties()

2015-11-26 Thread Jonathan Bayle (JIRA)
Jonathan Bayle created OLINGO-830:
-

 Summary: DefaultValue of a property not set in the map returned by 
ODataEntry.getProperties()
 Key: OLINGO-830
 URL: https://issues.apache.org/jira/browse/OLINGO-830
 Project: Olingo
  Issue Type: Bug
  Components: odata2-core
Affects Versions: V2 2.0.5
 Environment: Oracle JDK 1.7 u80
Reporter: Jonathan Bayle


Dear olingo developers,

The DefaultValue of a property not set in the map returned by 
{{ODataEntry.getProperties()}} when creating an entry.

I updated Olingo in my project from v2.0.1 to v2.0.5, this code:
{noformat}
  properties.add(new SimpleProperty().setName(PAGE_SIZE)
.setType(EdmSimpleTypeKind.Int32)
.setFacets(
  new Facets()
.setNullable(false)
.setDefaultValue("30")
)
  );
{noformat}
sets a default value of {{30}} to the PageSize property, 
 * with Olingo v2.0.1 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
an Integer whose value is 30
 * with Olingo v2.0.5 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
{{null}}.



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


[jira] [Commented] (OLINGO-830) DefaultValue of a property not set in the map returned by ODataEntry.getProperties()

2015-11-26 Thread Christian Amend (JIRA)

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

Christian Amend commented on OLINGO-830:


Hi,

does this happen after you deserialize a payload into an entry or if you pass 
an entry to our serializer to create the response which you send to a client?

It would help if you could share the code which builds the ODataEntry e.g. 
which Olingo method you call to get it and what the parameters are.

Best Regards,
Christian

> DefaultValue of a property not set in the map returned by 
> ODataEntry.getProperties()
> 
>
> Key: OLINGO-830
> URL: https://issues.apache.org/jira/browse/OLINGO-830
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-core
>Affects Versions: V2 2.0.5
> Environment: Oracle JDK 1.7 u80
>Reporter: Jonathan Bayle
>
> Dear olingo developers,
> The DefaultValue of a property not set in the map returned by 
> {{ODataEntry.getProperties()}} when creating an entry.
> I updated Olingo in my project from v2.0.1 to v2.0.5, this code:
> {noformat}
>   properties.add(new SimpleProperty().setName(PAGE_SIZE)
> .setType(EdmSimpleTypeKind.Int32)
> .setFacets(
>   new Facets()
> .setNullable(false)
> .setDefaultValue("30")
> )
>   );
> {noformat}
> sets a default value of {{30}} to the PageSize property, 
>  * with Olingo v2.0.1 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
> an Integer whose value is 30
>  * with Olingo v2.0.5 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
> {{null}}.



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


[jira] [Assigned] (OLINGO-830) DefaultValue of a property not set in the map returned by ODataEntry.getProperties()

2015-11-26 Thread Christian Amend (JIRA)

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

Christian Amend reassigned OLINGO-830:
--

Assignee: Christian Amend

> DefaultValue of a property not set in the map returned by 
> ODataEntry.getProperties()
> 
>
> Key: OLINGO-830
> URL: https://issues.apache.org/jira/browse/OLINGO-830
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-core
>Affects Versions: V2 2.0.5
> Environment: Oracle JDK 1.7 u80
>Reporter: Jonathan Bayle
>Assignee: Christian Amend
>
> Dear olingo developers,
> The DefaultValue of a property not set in the map returned by 
> {{ODataEntry.getProperties()}} when creating an entry.
> I updated Olingo in my project from v2.0.1 to v2.0.5, this code:
> {noformat}
>   properties.add(new SimpleProperty().setName(PAGE_SIZE)
> .setType(EdmSimpleTypeKind.Int32)
> .setFacets(
>   new Facets()
> .setNullable(false)
> .setDefaultValue("30")
> )
>   );
> {noformat}
> sets a default value of {{30}} to the PageSize property, 
>  * with Olingo v2.0.1 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
> an Integer whose value is 30
>  * with Olingo v2.0.5 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
> {{null}}.



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


[jira] [Commented] (OLINGO-830) DefaultValue of a property not set in the map returned by ODataEntry.getProperties()

2015-11-26 Thread Jonathan Bayle (JIRA)

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

Jonathan Bayle commented on OLINGO-830:
---

It happens after I deserialise a payload into an entry, in 
ODataSingleProcessor.createEntity(...)

Code is:
{noformat}
   @Override
   public ODataResponse createEntity(PostUriInfo uri_info, InputStream content, 
String rq_content_type, String content_type) throws ODataException
   {
  EntityProviderReadProperties properties = 
EntityProviderReadProperties.init().mergeSemantic(false).build();
  ODataEntry entry = EntityProvider.readEntry(rq_content_type, 
uri_info.getStartEntitySet(), content, properties);
  // ...
{noformat}

> DefaultValue of a property not set in the map returned by 
> ODataEntry.getProperties()
> 
>
> Key: OLINGO-830
> URL: https://issues.apache.org/jira/browse/OLINGO-830
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-core
>Affects Versions: V2 2.0.5
> Environment: Oracle JDK 1.7 u80
>Reporter: Jonathan Bayle
>Assignee: Christian Amend
>
> Dear olingo developers,
> The DefaultValue of a property not set in the map returned by 
> {{ODataEntry.getProperties()}} when creating an entry.
> I updated Olingo in my project from v2.0.1 to v2.0.5, this code:
> {noformat}
>   properties.add(new SimpleProperty().setName(PAGE_SIZE)
> .setType(EdmSimpleTypeKind.Int32)
> .setFacets(
>   new Facets()
> .setNullable(false)
> .setDefaultValue("30")
> )
>   );
> {noformat}
> sets a default value of {{30}} to the PageSize property, 
>  * with Olingo v2.0.1 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
> an Integer whose value is 30
>  * with Olingo v2.0.5 {{odata_entry.getProperties().get(PAGE_SIZE);}} returns 
> {{null}}.



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


[jira] [Assigned] (OLINGO-829) Olingo JPA chokes on filter expression

2015-11-26 Thread Chandan V.A (JIRA)

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

Chandan V.A reassigned OLINGO-829:
--

Assignee: Chandan V.A

> Olingo JPA chokes on filter expression
> --
>
> Key: OLINGO-829
> URL: https://issues.apache.org/jira/browse/OLINGO-829
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.6
> Environment: EclipseLink JPA provider
>Reporter: Richard Birenheide
>Assignee: Chandan V.A
>
> Olingo JPA chokes on the following filter expression:
> $filter=startswith(ABAPReference,%27TEST%27)%20and%20(ABAPReferenceType%20eq%20%27DataElement%27)
> with
> 
> class 
> org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException 
> : "org.apache.olingo.odata2.jpa.processor.core.ODataExpressionParser: "OData 
> - JPA Runtime: OData Expression parser - Operator EQ or NE missing". "
> 
> whereas the following
> $filter=(ABAPReferenceType%20eq%20%27DataElement%27)%20and%20startswith(ABAPReference,%27TEST%27)
> works fine. Just the order of the 'and' expression parts is reversed. 
> Unfortunately we use a frontend library which generates the expression 
> automatically. 



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


[jira] [Closed] (OLINGO-770) JPA OneToMany not able to create entity

2015-11-26 Thread Chandan V.A (JIRA)

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

Chandan V.A closed OLINGO-770.
--
Resolution: Fixed

Assuming the issue to be fixed. If not please reopen the ticket.

> JPA OneToMany not able to create entity
> ---
>
> Key: OLINGO-770
> URL: https://issues.apache.org/jira/browse/OLINGO-770
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.4
>Reporter: Miguel
>Assignee: Chandan V.A
>
> I have 2 entities OrderHeader and OrderItem,, the relation between then is 
> One To Many... with bi-directional
> In the OrderHeader 
> @OneToMany(mappedBy="OrderHeader")
> private List orderItems;
> In the OrderItem 
> @ManyToOne(fetch=FetchType.LAZY)
> @JoinColumn(name="ORDER_ID", nullable=false)
> private OrderHeader orderHeader;
> When the following is called
> ODataEntry entry = template.requestBody("olingo2://create/OrderHeaders", 
> body, ODataEntry.class);
> There is a exception thrown
> Could not match segment: 'OrderHeaders(4004280407L)/OrderItemDetails'.



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


[jira] [Assigned] (OLINGO-828) Navigation properties maintained in mapping xml get number suffixes

2015-11-26 Thread Chandan V.A (JIRA)

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

Chandan V.A reassigned OLINGO-828:
--

Assignee: Chandan V.A

> Navigation properties maintained in mapping xml get number suffixes
> ---
>
> Key: OLINGO-828
> URL: https://issues.apache.org/jira/browse/OLINGO-828
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.6
>Reporter: Richard Birenheide
>Assignee: Chandan V.A
> Attachments: globalFieldEdmMapping.xml
>
>
> I have multiple outgoing navigations to the SAME entity. In this case, when 
> overriding the generated names in the mapping xml, the navigation property 
> names get number suffixes nevertheless. See eg. attached mapping file where I 
> maintained relationship names for entity GlobalField. the realtionships to 
> approverDetail, responsibleUserDetail and lastChangedByUserDetail navigate 
> all to the same entity, GlobalUser. The final EDM then has Navigation 
> Properties:
> ToGlobalFieldApprover
> ToGlobalFieldResponsibleUser1
> ToLastChangedByUser2
> Note that neither the order in the mapping file nor the order in the JPA 
> entity determines which navigation property gets which suffix. Therefore its 
> some kind of a gamble whether this remains stable between different 
> deployments of the war file (it might depend on hashcodes, which is 
> inherently not guaranteed to be the same between deployments).



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


[jira] [Assigned] (OLINGO-736) JPAEntity does not update null values

2015-11-26 Thread Chandan V.A (JIRA)

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

Chandan V.A reassigned OLINGO-736:
--

Assignee: Chandan V.A

> JPAEntity does not update null values
> -
>
> Key: OLINGO-736
> URL: https://issues.apache.org/jira/browse/OLINGO-736
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.4
> Environment: Windows 7 64bit, Google Chrome 43.0.2357.134, JDK 
> 1.8.0_51
>Reporter: Reinhard Fuchs
>Assignee: Chandan V.A
>Priority: Minor
>
> In "JPAEntity.setProperty" there is an condition regarding null values ("if 
> (entityPropertyValue != null) ". This condition prevents database simple type 
> values being updateted with null value. According the OData Specification in 
> Point 3.3 (http://www.odata.org/documentation/odata-version-2-0/operations/) 
> this should work.
> Please complete this condition with an else:
> else {
>   method.invoke(entity, entityPropertyValue);
> }



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


[jira] [Commented] (OLINGO-828) Navigation properties maintained in mapping xml get number suffixes

2015-11-26 Thread Chandan V.A (JIRA)

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

Chandan V.A commented on OLINGO-828:


Hi Richard,
Issue is fixed with commit - 
http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/c6631df2.

However you can also set defaultNaming (in ODataJPAContext) to false so that 
names maintained on JPA Entity Model is considered and JPA Processor does not 
generate any names.

Thanks
Kind Regards
Chandan

> Navigation properties maintained in mapping xml get number suffixes
> ---
>
> Key: OLINGO-828
> URL: https://issues.apache.org/jira/browse/OLINGO-828
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.6
>Reporter: Richard Birenheide
>Assignee: Chandan V.A
> Fix For: V2 2.0.6
>
> Attachments: globalFieldEdmMapping.xml
>
>
> I have multiple outgoing navigations to the SAME entity. In this case, when 
> overriding the generated names in the mapping xml, the navigation property 
> names get number suffixes nevertheless. See eg. attached mapping file where I 
> maintained relationship names for entity GlobalField. the realtionships to 
> approverDetail, responsibleUserDetail and lastChangedByUserDetail navigate 
> all to the same entity, GlobalUser. The final EDM then has Navigation 
> Properties:
> ToGlobalFieldApprover
> ToGlobalFieldResponsibleUser1
> ToLastChangedByUser2
> Note that neither the order in the mapping file nor the order in the JPA 
> entity determines which navigation property gets which suffix. Therefore its 
> some kind of a gamble whether this remains stable between different 
> deployments of the war file (it might depend on hashcodes, which is 
> inherently not guaranteed to be the same between deployments).



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


[jira] [Closed] (OLINGO-828) Navigation properties maintained in mapping xml get number suffixes

2015-11-26 Thread Chandan V.A (JIRA)

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

Chandan V.A closed OLINGO-828.
--
   Resolution: Fixed
Fix Version/s: V2 2.0.6

> Navigation properties maintained in mapping xml get number suffixes
> ---
>
> Key: OLINGO-828
> URL: https://issues.apache.org/jira/browse/OLINGO-828
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.6
>Reporter: Richard Birenheide
>Assignee: Chandan V.A
> Fix For: V2 2.0.6
>
> Attachments: globalFieldEdmMapping.xml
>
>
> I have multiple outgoing navigations to the SAME entity. In this case, when 
> overriding the generated names in the mapping xml, the navigation property 
> names get number suffixes nevertheless. See eg. attached mapping file where I 
> maintained relationship names for entity GlobalField. the realtionships to 
> approverDetail, responsibleUserDetail and lastChangedByUserDetail navigate 
> all to the same entity, GlobalUser. The final EDM then has Navigation 
> Properties:
> ToGlobalFieldApprover
> ToGlobalFieldResponsibleUser1
> ToLastChangedByUser2
> Note that neither the order in the mapping file nor the order in the JPA 
> entity determines which navigation property gets which suffix. Therefore its 
> some kind of a gamble whether this remains stable between different 
> deployments of the war file (it might depend on hashcodes, which is 
> inherently not guaranteed to be the same between deployments).



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


[jira] [Commented] (OLINGO-828) Navigation properties maintained in mapping xml get number suffixes

2015-11-26 Thread Michael Bolz (JIRA)

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

Michael Bolz commented on OLINGO-828:
-

Hi [~chandan.v.a],

Thanks for the quick fix and clarification about the {{defaultNaming}} settings.

Best Regards,
Michael

> Navigation properties maintained in mapping xml get number suffixes
> ---
>
> Key: OLINGO-828
> URL: https://issues.apache.org/jira/browse/OLINGO-828
> Project: Olingo
>  Issue Type: Bug
>  Components: odata2-jpa
>Affects Versions: V2 2.0.6
>Reporter: Richard Birenheide
>Assignee: Chandan V.A
> Fix For: V2 2.0.6
>
> Attachments: globalFieldEdmMapping.xml
>
>
> I have multiple outgoing navigations to the SAME entity. In this case, when 
> overriding the generated names in the mapping xml, the navigation property 
> names get number suffixes nevertheless. See eg. attached mapping file where I 
> maintained relationship names for entity GlobalField. the realtionships to 
> approverDetail, responsibleUserDetail and lastChangedByUserDetail navigate 
> all to the same entity, GlobalUser. The final EDM then has Navigation 
> Properties:
> ToGlobalFieldApprover
> ToGlobalFieldResponsibleUser1
> ToLastChangedByUser2
> Note that neither the order in the mapping file nor the order in the JPA 
> entity determines which navigation property gets which suffix. Therefore its 
> some kind of a gamble whether this remains stable between different 
> deployments of the war file (it might depend on hashcodes, which is 
> inherently not guaranteed to be the same between deployments).



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