Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036624
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2017-08-08 11:282017-08-09 14:37
ReporterJONHMView Statuspublic 
Assigned Toplatform 
PriorityhighResolutionopenFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036624: Error thrown in web services if the URL includes a where parameter that references a computed column

DescriptionThe following error is thrown when trying to get data from an entity filtering from a computed column:

{"response":{"data":[{"response":{"status":-1,"error":{"message":"could not execute query using scroll","messageType":"Error","title":""},"totalRows":0}}
Steps To ReproduceUsing Postman:

- GET:
https://livebuilds.openbravo.com/erp_pi_pgsql/org.openbravo.service.json.jsonrest/FinancialMgmtPeriod?_where=status='P' [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0025773 closedalostale Error thrown in web services if the request includes a field that references a computed column 
related to design defect 00241043.0MP27 closedalostale Unnecessary evaluation of computed columns 

-  Notes
(0098452)
caristu (developer)
2017-08-09 14:12
edited on: 2017-08-09 14:38

Since MP27, when working with HQL (i.e. OBQuery) computed columns cannot be directly accessed as they are not properties of the entity[1].

Web services are internally making use of an OBQuery to return the results. Besides as stated here[2], the _where parameter should contain a valid HQL where-clause.

Therefore to filter the result of a Web Service based on a compute column, using the _where parameter, then the "_computedColumns" property must be used.

So, in this case the correct URL for the GET request will be:

https://livebuilds.openbravo.com/erp_pi_pgsql/org.openbravo.service.json.jsonrest/FinancialMgmtPeriod?_where=_computedColumns.status='P' [^]

[1] http://wiki.openbravo.com/wiki/How_to_create_a_Computed_Column#Limitations [^]
[2] http://wiki.openbravo.com/wiki/JSON_REST_Web_Services#GET [^]

(0098456)
caristu (developer)
2017-08-09 14:23
edited on: 2017-08-09 14:44

Updated wiki pages:

 http://wiki.openbravo.com/wiki/JSON_REST_Web_Services#GET [^]
 http://wiki.openbravo.com/wiki/ERP_2.50:Developers_Guide/Concepts/XML_REST_Web_Services#Query_Request_and_Response [^]


- Issue History
Date Modified Username Field Change
2017-08-08 11:28 JONHM New Issue
2017-08-08 11:28 JONHM Assigned To => platform
2017-08-08 11:28 JONHM Modules => Core
2017-08-08 11:28 JONHM Triggers an Emergency Pack => No
2017-08-08 11:28 JONHM Relationship added related to 0025773
2017-08-09 14:04 caristu Relationship added related to 0024104
2017-08-09 14:06 caristu Summary Error thrown in web services if the request includes a field that references a computed column => Error thrown in web services if the URL includes a where clause that references a computed column
2017-08-09 14:12 caristu Review Assigned To => caristu
2017-08-09 14:12 caristu Note Added: 0098452
2017-08-09 14:12 caristu Status new => closed
2017-08-09 14:13 caristu Summary Error thrown in web services if the URL includes a where clause that references a computed column => Error thrown in JSON web services if the URL includes a where clause that references a computed column
2017-08-09 14:13 caristu Summary Error thrown in JSON web services if the URL includes a where clause that references a computed column => Error thrown in JSON web services if the URL includes a where parameter that references a computed column
2017-08-09 14:14 caristu Note Edited: 0098452 View Revisions
2017-08-09 14:23 caristu Note Added: 0098456
2017-08-09 14:37 caristu Summary Error thrown in JSON web services if the URL includes a where parameter that references a computed column => Error thrown in web services if the URL includes a where parameter that references a computed column
2017-08-09 14:38 caristu Note Edited: 0098452 View Revisions
2017-08-09 14:38 caristu Note Edited: 0098452 View Revisions
2017-08-09 14:44 caristu Note Edited: 0098456 View Revisions


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker