Fixes Issue 23922: Tab tree it is not working under some circumstances
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Tue, 28 May 2013 10:04:28 +0530
changeset 20477 51de13657be6
parent 20476 7716d145ea66
child 20478 ded79d8fb1d0
Fixes Issue 23922: Tab tree it is not working under some circumstances

The alias was removed even if it was at the end of the word. This resulted in incorrect hql where clause.
Replaced alias only if its the present at the beginning of the string.
src/org/openbravo/erpCommon/utility/WindowTree.java
--- a/src/org/openbravo/erpCommon/utility/WindowTree.java	Mon May 27 17:54:17 2013 +0200
+++ b/src/org/openbravo/erpCommon/utility/WindowTree.java	Tue May 28 10:04:28 2013 +0530
@@ -245,7 +245,7 @@
 
     List<WindowTreeData> newSubList = new ArrayList<WindowTreeData>();
     if (hqlWhereClause != null && !hqlWhereClause.trim().isEmpty()) {
-      hqlWhereClause = hqlWhereClause.replace("e.", "");
+      hqlWhereClause = hqlWhereClause.replaceAll("\\Ae.", "");
       OBQuery<BaseOBObject> entityResults = OBDal.getInstance().createQuery("" + entityName + "",
           hqlWhereClause);
       if (nodeIdList == null) {