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

View Revisions: Issue #37112 Back to Issue ]
Summary 0037112: incorrect HQL to retrieve preferences
Revision 2017-10-19 10:36 by alostale
Steps To Reproduce Open login page and check hql generated for ForcedLoginURL preference [1] and the SQL it's finally executed.

HQL:
 as p  
 where (coalesce(p.visibleAtClient, '0')='0')  
 and (p.visibleAtRole is null)      
 and (coalesce(p.visibleAtOrganization, '0')='0')) 
 and (p.userContact is null)  
 and (p.window is null)  
 and p.propertyList = 'Y' 
 and p.property = ?  
 order by p.AD_Window_ID


SQL:
  ...
  from AD_Preference adpreferen0_ 
  where coalesce(adpreferen0_.VisibleAt_Client_ID, '0')='0' 
  and (adpreferen0_.VisibleAt_Role_ID is null) 
  and coalesce(adpreferen0_.VisibleAt_Org_ID, '0')='0' 
  and (adpreferen0_.AD_User_ID is null) 
  and (adpreferen0_.AD_Window_ID is null) 
  and adpreferen0_.IsPropertyList='Y' 
  and adpreferen0_.Property=?


Removing the extra parenthesis in the HQL, the correct SQL is:
  from AD_Preference adpreferen0_ 
  where coalesce(adpreferen0_.VisibleAt_Client_ID, '0')='0' 
  and (adpreferen0_.VisibleAt_Role_ID is null) 
  and coalesce(adpreferen0_.VisibleAt_Org_ID, '0')='0' 
  and (adpreferen0_.AD_User_ID is null) 
  and (adpreferen0_.AD_Window_ID is null) 
  and adpreferen0_.IsPropertyList='Y' 
  and adpreferen0_.Property=? 
  and (adpreferen0_.AD_Org_ID in ('0'))
  and (adpreferen0_.AD_Client_ID in ('0')) 
  and adpreferen0_.IsActive='Y' 
  order by adpreferen0_.AD_Preference_ID


---
[1] https://code.openbravo.com/erp/devel/pi/file/c77412df1f7e/src/org/openbravo/erpCommon/businessUtility/Preferences.java#l455 [^]
Revision 2017-10-19 10:32 by alostale
Steps To Reproduce Open login page and check hql generated for ForcedLoginURL preference [1] and the SQL it's finally executed.

HQL:
 as p  
 where (coalesce(p.visibleAtClient, '0')='0')  
 and (p.visibleAtRole is null)      
 and (coalesce(p.visibleAtOrganization, '0')='0')) 
 and (p.userContact is null)  
 and (p.window is null)  
 and p.propertyList = 'Y' 
 and p.property = ?  
 order by p.AD_Window_ID


SQL:
  ...
  from AD_Preference adpreferen0_ 
  where coalesce(adpreferen0_.VisibleAt_Client_ID, '0')='0' 
  and (adpreferen0_.VisibleAt_Role_ID is null) 
  and coalesce(adpreferen0_.VisibleAt_Org_ID, '0')='0' 
  and (adpreferen0_.AD_User_ID is null) 
  and (adpreferen0_.AD_Window_ID is null) 
  and adpreferen0_.IsPropertyList='Y' 
  and adpreferen0_.Property=?


Removing the extra parenthesis in the HQL, the correct SQL is:
  from AD_Preference adpreferen0_ 
  where coalesce(adpreferen0_.VisibleAt_Client_ID, '0')='0' 
  and (adpreferen0_.VisibleAt_Role_ID is null) 
  and coalesce(adpreferen0_.VisibleAt_Org_ID, '0')='0' 
  and (adpreferen0_.AD_User_ID is null) 
  and (adpreferen0_.AD_Window_ID is null) 
  and adpreferen0_.IsPropertyList='Y' 
  and adpreferen0_.Property=? 
  and (adpreferen0_.AD_Org_ID in ('0'))
  and (adpreferen0_.AD_Client_ID in ('0')) 
  and adpreferen0_.IsActive='Y' 
  order by adpreferen0_.AD_Preference_ID


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker