[jira] [Commented] (OLINGO-1147) Entity read is not working due to normalization in JPAQueryBuilder
[ https://issues.apache.org/jira/browse/OLINGO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16083440#comment-16083440 ] Michael Bolz commented on OLINGO-1147: -- I currently do not have the time for a deep lock into the issue. However after a quick look into the code a solution could be to remove such property value parts like the {{‘ENTITY_NAME.1.2’}} before the normalisation needed check. Then we do the check on the query with removed parameter and if it is still true proceed the normalisation with the full query. Regards, Michael > Entity read is not working due to normalization in JPAQueryBuilder > -- > > Key: OLINGO-1147 > URL: https://issues.apache.org/jira/browse/OLINGO-1147 > Project: Olingo > Issue Type: Bug > Components: odata2-core >Affects Versions: V2 2.0.8 >Reporter: Daniel Horvath >Priority: Blocker > > Hello Colleagues, > We have found a bug in JPAQueryBuilder. In version 2.0.7 it is working fine > but in version 2.0.8 where the normalizeMembers() method is added it fails on > certain queries. > The error happens in line 180: {color:red}return > em.createQuery(normalizeMembers(jpqlStatement.toString()));{color} > The query before normalisation: > *SELECT E1 FROM Entity E1 WHERE E1.id = 'ENTITY_NAME.1.2'* > After the normalisation the query looks like this (an invalid query): > *SELECT DISTINCT E1 FROM Entity E1 JOIN 'ENTITY_NAME.1 R1 WHERE E1.id = R1.2'* > The regular expression finds this query as it should be normalised because of > the id part ('ENTITY_NAME.1.2'). As we found out, this is caused by the point > characters in the id field. It should not be found by the reg. exp. because > this is inside of apostrophes. > If you have further questions, please contact me. > Best regards, > Daniel -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OLINGO-1150) Can't read Decimal value which value bigger than 10M from MicrosoftCRM
[ https://issues.apache.org/jira/browse/OLINGO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16083415#comment-16083415 ] Jin ZHAO commented on OLINGO-1150: -- There should be 2 issue need to consider: # When jackson parse response to json tree, it change *31991163.* to *3.1991163E7* # when _call org.apache.olingo.commons.core.edm.primitivetype.EdmDecimal.internalValueOfString(...)_ it _call validateLiteral(..)_ which not included scientific notation. > Can't read Decimal value which value bigger than 10M from MicrosoftCRM > -- > > Key: OLINGO-1150 > URL: https://issues.apache.org/jira/browse/OLINGO-1150 > Project: Olingo > Issue Type: Bug >Affects Versions: (Java) V4 4.3.0 >Reporter: Jin ZHAO >Priority: Blocker > > {code:java} > { > > "@odata.context":"https://talend.api.crm.dynamics.com/api/data/v8.1/$metadata#salesorders(salesorderid,new_talend_test)","#Microsoft.Dynamics.CRM.FulfillSalesOrder":{ > > "title":"FulfillSalesOrder","target":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders/Microsoft.Dynamics.CRM.FulfillSalesOrder; > },"#Microsoft.Dynamics.CRM.ValidateSharePointFolder":{ > > "title":"ValidateSharePointFolder","target":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders/Microsoft.Dynamics.CRM.ValidateSharePointFolder; > },"value":[ > { > > "@odata.type":"#Microsoft.Dynamics.CRM.salesorder","@odata.id":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)","@odata.etag":"W/\"7048734\"","@odata.editLink":"salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)","salesorde...@odata.type":"#Guid","salesorderid":"6a5ef029-1b66-e711-8114-e0071b6ad141","new_talend_t...@odata.type":"#Decimal","new_talend_test":31991163.,"_transactioncurrencyid_va...@odata.type":"#Guid","_transactioncurrencyid_value":"dca1714c-6d1a-e311-a5fb-b4b52f67b688","transactioncurrencyid@odata.associationLink":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)/transactioncurrencyid/$ref","transactioncurrencyid@odata.navigationLink":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)/transactioncurrencyid" > } > ] > } > {code} > We have this kind of response from Microsoft CRM which included this kind of > value: > {code:java} > "new_talend_t...@odata.type":"#Decimal","new_talend_test":31991163. > {code} > bellow is the error: > {code:java} > Exception in component tMicrosoftCrmInput_4 (TestCase_tMicrosoftCRMInput) > java.lang.IllegalArgumentException: > org.apache.olingo.client.api.serialization.ODataDeserializerException: > java.io.IOException: > org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal > '3.1991163E7' has illegal content. > at > org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl$ODataEntitySetResponseImpl.getBody(ODataEntitySetRequestImpl.java:87) > at > org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl$ODataEntitySetResponseImpl.getBody(ODataEntitySetRequestImpl.java:68) > at > local_project.testcase_tmicrosoftcrminput_0_1.TestCase_tMicrosoftCRMInput.tMicrosoftCrmInput_4Process(TestCase_tMicrosoftCRMInput.java:743) > at > local_project.testcase_tmicrosoftcrminput_0_1.TestCase_tMicrosoftCRMInput.runJobInTOS(TestCase_tMicrosoftCRMInput.java:1140) > at > local_project.testcase_tmicrosoftcrminput_0_1.TestCase_tMicrosoftCRMInput.main(TestCase_tMicrosoftCRMInput.java:989) > Caused by: > org.apache.olingo.client.api.serialization.ODataDeserializerException: > java.io.IOException: > org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal > '3.1991163E7' has illegal content. > at > org.apache.olingo.client.core.serialization.JsonDeserializer.toEntitySet(JsonDeserializer.java:402) > at > org.apache.olingo.client.core.serialization.ClientODataDeserializerImpl.toEntitySet(ClientODataDeserializerImpl.java:73) > at > org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl$ODataEntitySetResponseImpl.getBody(ODataEntitySetRequestImpl.java:83) > ... 4 more > Caused by: java.io.IOException: > org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal > '3.1991163E7' has illegal content. > at > org.apache.olingo.client.core.serialization.JsonEntityDeserializer.doDeserialize(JsonEntityDeserializer.java:236) > at > org.apache.olingo.client.core.serialization.JsonEntitySetDeserializer.doDeserialize(JsonEntitySetDeserializer.java:100) > at > org.apache.olingo.client.core.serialization.JsonDeserializer.toEntitySet(JsonDeserializer.java:400) > ... 6 more > Caused
[jira] [Created] (OLINGO-1150) Can't read Decimal value which value bigger than 10M from MicrosoftCRM
Jin ZHAO created OLINGO-1150: Summary: Can't read Decimal value which value bigger than 10M from MicrosoftCRM Key: OLINGO-1150 URL: https://issues.apache.org/jira/browse/OLINGO-1150 Project: Olingo Issue Type: Bug Affects Versions: (Java) V4 4.3.0 Reporter: Jin ZHAO Priority: Blocker {code:java} { "@odata.context":"https://talend.api.crm.dynamics.com/api/data/v8.1/$metadata#salesorders(salesorderid,new_talend_test)","#Microsoft.Dynamics.CRM.FulfillSalesOrder":{ "title":"FulfillSalesOrder","target":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders/Microsoft.Dynamics.CRM.FulfillSalesOrder; },"#Microsoft.Dynamics.CRM.ValidateSharePointFolder":{ "title":"ValidateSharePointFolder","target":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders/Microsoft.Dynamics.CRM.ValidateSharePointFolder; },"value":[ { "@odata.type":"#Microsoft.Dynamics.CRM.salesorder","@odata.id":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)","@odata.etag":"W/\"7048734\"","@odata.editLink":"salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)","salesorde...@odata.type":"#Guid","salesorderid":"6a5ef029-1b66-e711-8114-e0071b6ad141","new_talend_t...@odata.type":"#Decimal","new_talend_test":31991163.,"_transactioncurrencyid_va...@odata.type":"#Guid","_transactioncurrencyid_value":"dca1714c-6d1a-e311-a5fb-b4b52f67b688","transactioncurrencyid@odata.associationLink":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)/transactioncurrencyid/$ref","transactioncurrencyid@odata.navigationLink":"https://talend.api.crm.dynamics.com/api/data/v8.1/salesorders(6a5ef029-1b66-e711-8114-e0071b6ad141)/transactioncurrencyid" } ] } {code} We have this kind of response from Microsoft CRM which included this kind of value: {code:java} "new_talend_t...@odata.type":"#Decimal","new_talend_test":31991163. {code} bellow is the error: {code:java} Exception in component tMicrosoftCrmInput_4 (TestCase_tMicrosoftCRMInput) java.lang.IllegalArgumentException: org.apache.olingo.client.api.serialization.ODataDeserializerException: java.io.IOException: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal '3.1991163E7' has illegal content. at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl$ODataEntitySetResponseImpl.getBody(ODataEntitySetRequestImpl.java:87) at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl$ODataEntitySetResponseImpl.getBody(ODataEntitySetRequestImpl.java:68) at local_project.testcase_tmicrosoftcrminput_0_1.TestCase_tMicrosoftCRMInput.tMicrosoftCrmInput_4Process(TestCase_tMicrosoftCRMInput.java:743) at local_project.testcase_tmicrosoftcrminput_0_1.TestCase_tMicrosoftCRMInput.runJobInTOS(TestCase_tMicrosoftCRMInput.java:1140) at local_project.testcase_tmicrosoftcrminput_0_1.TestCase_tMicrosoftCRMInput.main(TestCase_tMicrosoftCRMInput.java:989) Caused by: org.apache.olingo.client.api.serialization.ODataDeserializerException: java.io.IOException: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal '3.1991163E7' has illegal content. at org.apache.olingo.client.core.serialization.JsonDeserializer.toEntitySet(JsonDeserializer.java:402) at org.apache.olingo.client.core.serialization.ClientODataDeserializerImpl.toEntitySet(ClientODataDeserializerImpl.java:73) at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl$ODataEntitySetResponseImpl.getBody(ODataEntitySetRequestImpl.java:83) ... 4 more Caused by: java.io.IOException: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal '3.1991163E7' has illegal content. at org.apache.olingo.client.core.serialization.JsonEntityDeserializer.doDeserialize(JsonEntityDeserializer.java:236) at org.apache.olingo.client.core.serialization.JsonEntitySetDeserializer.doDeserialize(JsonEntitySetDeserializer.java:100) at org.apache.olingo.client.core.serialization.JsonDeserializer.toEntitySet(JsonDeserializer.java:400) ... 6 more Caused by: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal '3.1991163E7' has illegal content. at org.apache.olingo.commons.core.edm.primitivetype.EdmDecimal.internalValueOfString(EdmDecimal.java:90) at org.apache.olingo.commons.core.edm.primitivetype.AbstractPrimitiveType.valueOfString(AbstractPrimitiveType.java:69) at org.apache.olingo.client.core.serialization.JsonDeserializer.fromPrimitive(JsonDeserializer.java:293) at org.apache.olingo.client.core.serialization.JsonDeserializer.value(JsonDeserializer.java:385) at