Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012903Openbravo ERPA. Platformpublic2010-04-07 17:282010-04-19 21:12
shuehner 
mtaal 
normalminorhave not tried
closedfixed 
5
pi 
2.50MP15 
Core
No
0012903: Error in OBQuery when using with hql clause having order by but not where part
Using the following code snippet fails to execute:

products = OBDal.getInstance().createQuery(Product.class, " as e order by name");
products.setFilterOnReadableOrganization(false);
products.setFilterOnReadableClients(false);
assertTrue(products.count() > 0);

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1949)
    at org.openbravo.dal.service.OBQuery.createQueryString(OBQuery.java:215)
    at org.openbravo.dal.service.OBQuery.count(OBQuery.java:140)
Use attached junit testcases
No tags attached.
related to defect 0012853pi closed mtaal OBQuery count not working with a query with aliases 
diff testcases_for_12903.diff (1,742) 2010-04-07 17:31
https://issues.openbravo.com/file_download.php?file_id=2414&type=bug
Issue History
2010-04-07 17:28shuehnerNew Issue
2010-04-07 17:28shuehnerAssigned To => mtaal
2010-04-07 17:31shuehnerFile Added: testcases_for_12903.diff
2010-04-07 17:32shuehnerNote Added: 0025952
2010-04-07 17:32shuehnerRelationship addedrelated to 0012853
2010-04-07 17:32shuehnerNote Added: 0025953
2010-04-08 09:36hgbotCheckin
2010-04-08 09:36hgbotNote Added: 0025968
2010-04-08 09:36hgbotStatusnew => resolved
2010-04-08 09:36hgbotResolutionopen => fixed
2010-04-08 09:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c56bf39535655e046da329134721985ec44bc916 [^]
2010-04-14 19:05marvintmNote Added: 0026217
2010-04-14 19:05marvintmStatusresolved => closed
2010-04-14 19:05marvintmFixed in Version => 2.50MP15
2010-04-15 00:00anonymoussf_bug_id0 => 2987423
2010-04-19 21:12hudsonbotCheckin
2010-04-19 21:12hudsonbotNote Added: 0026435

Notes
(0025952)
shuehner   
2010-04-07 17:32   
Note: testcases just excercise various hql queries combinations of alias,where,order by.

The testcases perhaps need to be extended with specific ones depending on the fix done for this issue.
(0025953)
shuehner   
2010-04-07 17:32   
Adding related as issue was found reviewing 12853.
(0025968)
hgbot   
2010-04-08 09:36   
Repository: erp/devel/pi
Changeset: c56bf39535655e046da329134721985ec44bc916
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Apr 08 09:47:48 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c56bf39535655e046da329134721985ec44bc916 [^]

fixes issue 12903: Error in OBQuery when using with hql clause having order by but not where part

---
M src-test/org/openbravo/test/dal/IssuesTest.java
M src/org/openbravo/dal/service/OBQuery.java
---
(0026217)
marvintm   
2010-04-14 19:05   
The code looks fine and the tests run correctly
(0026435)
hudsonbot   
2010-04-19 21:12   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/c56bf3953565 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/91d98bda46c1 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17088.obx [^]