details:   /erp/devel/pi/rev/daddaf069115
changeset: 10517:daddaf069115
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Thu Feb 10 11:17:18 2011 +0100
summary:   Improve performance of new check added in changeset 49fcf5bafec1

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
 |  19 +++++----
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (37 lines):

diff -r 4f16c638daf8 -r daddaf069115 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Thu Feb 10 10:20:38 2011 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Thu Feb 10 11:17:18 2011 +0100
@@ -30,6 +30,7 @@
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
 import org.openbravo.model.ad.access.Role;
 import org.openbravo.model.ad.access.RoleOrganization;
 import org.openbravo.model.ad.access.User;
@@ -48,15 +49,17 @@
   private static Logger log = Logger.getLogger(ApplicationUtils.class);
 
   static boolean showWindowInClassicMode(Window window) {
+    // FIXME Remove this once ImageBLOB is implemented
+    // Currently, windows with ImageBLOB reference columns will be shown in 
classic mode
+    String qryStr = "as f where f.column.reference.id = 
'4AA6C3BE9D3B4D84A3B80489505A23E5' "
+        + "and f.tab.window.id = :windowId ";
+    OBQuery<Field> qry = OBDal.getInstance().createQuery(Field.class, qryStr);
+    qry.setNamedParameter("windowId", window.getId());
+    if (qry.count() > 0) {
+      return true;
+    }
+
     for (Tab tab : window.getADTabList()) {
-
-      // FIXME Remove this once ImageBLOB is implemented
-      // Currently, windows with ImageBLOB reference columns will be shown in 
classic mode
-      for (Field field : tab.getADFieldList()) {
-        if 
(field.getColumn().getReference().getId().equals("4AA6C3BE9D3B4D84A3B80489505A23E5"))
 {
-          return true;
-        }
-      }
       if (tab.getSQLWhereClause() != null && tab.getHqlwhereclause() == null) {
         // There is a tab with a SQL whereclause, but without a defined HQL 
whereclause
         return true;

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to