Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015056Openbravo ERPA. Platformpublic2010-10-27 19:342010-12-09 16:07
networkb 
mtaal 
normalmajorhave not tried
closedfixed 
5
pi 
2.50MP24 
Core
No
0015056: OBQuery: whereclause with alias with a comma direct after the alias fails
This usage of OBQuery:
OBQuery<SyncPointReg> datosTablaOBEliminados = OBDal.getInstance().createQuery(SyncPointReg.class, whereClause.toString());
        
//My whereClause is:

whereClause.append(" AS reg, AD_Audit_Trail_Raw AS au where reg.id = au.recordID ");
whereClause.append(" and au.table.id = '291'");
whereClause.append(" and reg.active=true and action='D' and reg.pointSinc.id='546529A797B545B8BB14C8317795213A'");
whereClause.append(" and au.oldChar=au.client.id ORDER BY au.creationDate");

Results in this error:
select reg, from wss_syncpointreg AS reg, AD_Audit_Trail_Raw AS au where ( reg.identificadorOpenbravo = au.recordID and au.table.id = '291' and reg.active=true and action='D' and reg.pointSinc.id='546529A797B545B8BB14C8317795213A' and au.oldChar=au.client.id ) and reg,.organization.id in ('0', '105DE888FFEB49E18C828E8C45945203') and reg,.client.id in ('AAE2DE59A6654E1097733152573FE150', '0') and reg,.active='Y' ORDER BY au.creationDate

Note, the comma which is added just after the alias in the select clause.

See this forum post:
http://forge.openbravo.com/plugins/espforum/view.php?group_id=100&forumid=549512&topicid=7019996 [^]
No tags attached.
duplicate of defect 0015050pi closed mtaal OBQuery: whereclause with alias with a comma direct after the alias fails 
Issue History
2010-10-27 19:34networkbNew Issue
2010-10-27 19:34networkbAssigned To => mtaal
2010-10-27 19:34networkbIssue generated from0015050
2010-10-27 19:36networkbRelationship addedduplicate of 0015050
2010-10-27 21:23hgbotCheckin
2010-10-27 21:23hgbotNote Added: 0032278
2010-10-27 21:23hgbotStatusnew => resolved
2010-10-27 21:23hgbotResolutionopen => fixed
2010-10-27 21:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4386178275271efff07e1917ce1a2cb37167e242 [^]
2010-11-05 12:44hudsonbotCheckin
2010-11-05 12:44hudsonbotNote Added: 0032434
2010-11-18 11:05marvintmNote Added: 0032695
2010-11-18 11:05marvintmStatusresolved => closed
2010-12-09 16:07anonymoussf_bug_id0 => 3133532

Notes
(0032278)
hgbot   
2010-10-27 21:23   
Repository: erp/devel/pi
Changeset: 4386178275271efff07e1917ce1a2cb37167e242
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Oct 27 21:23:12 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4386178275271efff07e1917ce1a2cb37167e242 [^]

Fixes issue 15050: OBQuery: whereclause with alias with a comma direct after the alias fails
Fixes issue 15056: OBQuery: whereclause with alias with a comma direct after the alias fails

---
M src-test/org/openbravo/test/dal/IssuesTest.java
M src/org/openbravo/dal/service/OBQuery.java
---
(0032434)
hudsonbot   
2010-11-05 12:44   
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/438617827527 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/f2cf138fa03c [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18797.obx [^]
(0032695)
marvintm   
2010-11-18 11:05   
Tested with an equivalent example and code reviewed the diff.