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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0023743
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2013-05-06 13:102013-06-04 07:15
ReporterdbazView Statuspublic 
Assigned Toshankarb 
PriorityhighResolutionfixedFixed in Version3.0MP24
StatusclosedFix in branchFixed in SCM revision28d3d4f719c6
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomtaal
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0023743: OBDal.getInstance().createQuery second parameter 'where' word now must be lowercase

DescriptionOBDal.getInstance().createQuery second parameter 'where' word now must be lowercase. It is quite strange and it should allow also 'WHERE' uppercase word.
Steps To ReproduceWrite some dummy java code like

  String whereClause = " AS project WHERE project.active = 'Y'";
  OBQuery<Project> projectListQuery = OBDal.getInstance().createQuery(Project.class, whereClause);
  List<Project> projectList = projectListQuery.list();

It fails: unexpected token: where near line ...

TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0058714)
hgbot (developer)
2013-05-21 10:04

Repository: erp/devel/pi
Changeset: 28d3d4f719c66ccfaa06b0db239db49a11b40939
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Tue May 21 13:28:36 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/28d3d4f719c66ccfaa06b0db239db49a11b40939 [^]

Fixes Issue 0023743: In createQuery second parameter 'where' word now must be lowercase

If the whereClause of OBQuery contains 'WHERE', 'org.hibernate.hql.PARSER - line 1:101: unexpected token: where' error is raised.
Replaced all occurences of 'WHERE' to lowercase in createQueryString method.

---
M src/org/openbravo/dal/service/OBQuery.java
---
(0058715)
mtaal (manager)
2013-05-21 10:09

Imhv this is a great issue to have a testcase for it in this junit test:
https://code.openbravo.com/erp/devel/pi/file/28d3d4f719c6/src-test/org/openbravo/test/dal/IssuesTest.java [^]

can you add a testcase?

gr. Martin
(0058716)
shankarb (reporter)
2013-05-21 10:11

Sure Martin.
(0058717)
hgbot (developer)
2013-05-21 10:55

Repository: erp/devel/pi
Changeset: 31353433f34e4fb62a0ec1c94c8feb01dd096b73
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Tue May 21 14:24:39 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/31353433f34e4fb62a0ec1c94c8feb01dd096b73 [^]

Related to Issue 23743 : Added test case

---
M src-test/org/openbravo/test/dal/IssuesTest.java
---
(0058723)
dbaz (developer)
2013-05-21 13:36

Hi, I would recommend a solution like

qryStr = qryStr.replaceAll(" WHERE ", " where ");

to avoid words like "somewhere" be modified due to this massive replacement.

Just my two cents.

Regards.
(0058724)
hgbot (developer)
2013-05-21 14:11

Repository: erp/devel/pi
Changeset: d48fd49cb8fe102d362a6ca46202446188b6f1b9
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Tue May 21 17:37:29 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d48fd49cb8fe102d362a6ca46202446188b6f1b9 [^]

Related to Issue 23743 : Code refactoring

Moved logic from createQueryString to getWhereAndOrderBy method.

---
M src/org/openbravo/dal/service/OBQuery.java
---
(0058725)
shankarb (reporter)
2013-05-21 14:16

Hi David,
Yes that is a case where the code would fail. Thank you.

Shankar
(0058726)
hgbot (developer)
2013-05-21 14:33

Repository: erp/devel/pi
Changeset: 3efd192fdaae1fca2c0993b83dec3ad0f8f78472
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Tue May 21 17:58:31 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/3efd192fdaae1fca2c0993b83dec3ad0f8f78472 [^]

Related to Issue 23743 : Code Refactoring to replace ' WHERE ' to avoid replacing words like 'SOMEWHERE'

Replaced " WHERE " instead of "WHERE" so that words that has where in it like "SOMEWHERE" are not replaced incorrectly.

---
M src/org/openbravo/dal/service/OBQuery.java
---
(0058838)
hudsonbot (developer)
2013-05-23 01:34

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/97c7f6256af7 [^]

Maturity status: Test
(0058839)
hudsonbot (developer)
2013-05-23 01:34

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/97c7f6256af7 [^]

Maturity status: Test
(0058842)
hudsonbot (developer)
2013-05-23 01:34

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/97c7f6256af7 [^]

Maturity status: Test
(0058843)
hudsonbot (developer)
2013-05-23 01:34

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/97c7f6256af7 [^]

Maturity status: Test
(0059137)
mtaal (manager)
2013-06-04 07:15

Reviewed

- Issue History
Date Modified Username Field Change
2013-05-06 13:10 dbaz New Issue
2013-05-06 13:10 dbaz Assigned To => mtaal
2013-05-06 13:10 dbaz Modules => Core
2013-05-06 13:10 dbaz Triggers an Emergency Pack => No
2013-05-21 09:37 shankarb Assigned To mtaal => shankarb
2013-05-21 10:00 shankarb Review Assigned To => AugustoMauch
2013-05-21 10:01 shankarb Issue Monitored: AugustoMauch
2013-05-21 10:02 shankarb Issue End Monitor: AugustoMauch
2013-05-21 10:02 shankarb Issue Monitored: mtaal
2013-05-21 10:03 shankarb Review Assigned To AugustoMauch => mtaal
2013-05-21 10:04 hgbot Checkin
2013-05-21 10:04 hgbot Note Added: 0058714
2013-05-21 10:04 hgbot Status new => resolved
2013-05-21 10:04 hgbot Resolution open => fixed
2013-05-21 10:04 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/28d3d4f719c66ccfaa06b0db239db49a11b40939 [^]
2013-05-21 10:09 mtaal Note Added: 0058715
2013-05-21 10:11 shankarb Note Added: 0058716
2013-05-21 10:55 hgbot Checkin
2013-05-21 10:55 hgbot Note Added: 0058717
2013-05-21 13:36 dbaz Note Added: 0058723
2013-05-21 14:11 hgbot Checkin
2013-05-21 14:11 hgbot Note Added: 0058724
2013-05-21 14:16 shankarb Note Added: 0058725
2013-05-21 14:33 hgbot Checkin
2013-05-21 14:33 hgbot Note Added: 0058726
2013-05-23 01:34 hudsonbot Checkin
2013-05-23 01:34 hudsonbot Note Added: 0058838
2013-05-23 01:34 hudsonbot Checkin
2013-05-23 01:34 hudsonbot Note Added: 0058839
2013-05-23 01:34 hudsonbot Checkin
2013-05-23 01:34 hudsonbot Note Added: 0058842
2013-05-23 01:34 hudsonbot Checkin
2013-05-23 01:34 hudsonbot Note Added: 0058843
2013-06-04 07:15 mtaal Note Added: 0059137
2013-06-04 07:15 mtaal Status resolved => closed
2013-06-04 07:15 mtaal Fixed in Version => 3.0MP24


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker