details:   https://code.openbravo.com/erp/devel/pi/rev/28d3d4f719c6
changeset: 20406:28d3d4f719c6
user:      Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date:      Tue May 21 13:28:36 2013 +0530
summary:   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.

diffstat:

 src/org/openbravo/dal/service/OBQuery.java |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 83655f9606f4 -r 28d3d4f719c6 src/org/openbravo/dal/service/OBQuery.java
--- a/src/org/openbravo/dal/service/OBQuery.java        Mon May 20 17:45:39 
2013 +0200
+++ b/src/org/openbravo/dal/service/OBQuery.java        Tue May 21 13:28:36 
2013 +0530
@@ -246,7 +246,9 @@
 
   String createQueryString() {
     // split the orderby and where
-    final String qryStr = getWhereAndOrderBy();
+    String qryStr = getWhereAndOrderBy();
+    // replace WHERE keyword to lowercase as hql exception is generated in 
org.hibernate.hql.PARSER
+    qryStr = qryStr.replaceAll("WHERE", "where");
     final String orderByClause;
     String whereClause;
     final int orderByIndex = qryStr.toLowerCase().indexOf(ORDERBY);

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to