Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038250Retail ModulesWeb POSpublic2018-03-28 16:432018-04-26 15:37
shuehner 
Sandrahuguet 
normalminorhave not tried
closedfixed 
5
 
RR18Q3 
marvintm
No
0038250: Query in Context servlet (aka org.openbravo.mobile.core.context) has extra join which is not needed.
HQL Query inside that class:

    String hqlUser = "select u as user, r as role, org as organization, cli as client "
        + "from ADUser u left outer join u.businessPartner bp, ADRole r, Organization org, ADClient cli "
        + "where u.id = :userId " + " and u.active = true " + " and r.id = :roleId "
        + " and org.id = :orgId " + " and cli.id = :clientId ";

Does an extra left outer join to u.businessPartner (c_bpartner table) with alias bp.
That alias then is never used in output or other parts of the query so should be removed.

As that is left outer join pointing to primary key of c_bpartner table removing the join will not change number of rows in result either.
-
Delete the extra not needed join
Performance
Issue History
2018-03-28 16:43shuehnerNew Issue
2018-03-28 16:43shuehnerAssigned To => Sandrahuguet
2018-03-28 16:43shuehnerTriggers an Emergency Pack => No
2018-03-28 16:44shuehnerTag Attached: Performance
2018-04-04 08:33hgbotCheckin
2018-04-04 08:33hgbotNote Added: 0103658
2018-04-04 08:33hgbotStatusnew => resolved
2018-04-04 08:33hgbotResolutionopen => fixed
2018-04-04 08:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/156ba6e63e82074aed1959b0ad610e849eb3a275 [^]
2018-04-04 08:34SandrahuguetReview Assigned To => marvintm
2018-04-04 08:34SandrahuguetFixed in Version => RR18Q3
2018-04-26 15:37marvintmStatusresolved => closed

Notes
(0103658)
hgbot   
2018-04-04 08:33   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 156ba6e63e82074aed1959b0ad610e849eb3a275
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Apr 03 09:10:27 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/156ba6e63e82074aed1959b0ad610e849eb3a275 [^]

Fixed issue 38250 delete unneded extra join

---
M src/org/openbravo/mobile/core/login/Context.java
---