[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3186) session.createQuery method stripping braces when or condition is present
Jerry Pothen (JIRA)
noreply at atlassian.com
Sun Mar 16 01:16:33 EDT 2008
session.createQuery method stripping braces when or condition is present
------------------------------------------------------------------------
Key: HHH-3186
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3186
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6, 3.2.5
Environment: RAD 6.0.1.4, Hibernate 3.2.5, DB UDB 9
Reporter: Jerry Pothen
Attachments: Hibernate_Issue_2008_03_16.txt
Please note the removal of the braces separating the OR condition. I don't know if I'm doing something stupid. Any help would be greatly appreciated.
The HQL passed to the create query method is:
from QueueCustomerView where (formStatusId in (102, 103, 104, 105)) and (accountOfficer in ('U001927', 'C001739', 'U002083', 'U002209', 'C002366', 'U001878', 'U001928', 'C002076', 'U841390', 'C002355', 'C001861', 'U002195', 'C002345', 'C001762', 'C001767', 'C002364', 'C002346')) and ((responsibleBranchId = 108 and businessLineId = 100) or (responsibleBranchId = 130 and businessLineId = 104) or (responsibleBranchId = 127 and businessLineId = 112) or (responsibleBranchId = 122 and businessLineId = 112)) order by customerStatusId desc , reassessmentDate asc
The SQL query hibernate outputs to the console is:
select queuecusto0_.field1,..., queuecusto0_.field2 from kycr.vw_customer_queue queuecusto0_ where (queuecusto0_.STATUS_ID in (102 , 103 , 104 , 105)) and (queuecusto0_.ACCT_OFF_ID in ('U001927' , 'C001739' , 'U002083' , 'U002209' , 'C002366' , 'U001878' , 'U001928' , 'C002076' , 'U841390' , 'C002355' , 'C001861' , 'U002195' , 'C002345' , 'C001762' , 'C001767' , 'C002364' , 'C002346')) and (queuecusto0_.BK_BRNCH=108 and queuecusto0_.BUSNSS_LINE=100 or queuecusto0_.BK_BRNCH=130 and queuecusto0_.BUSNSS_LINE=104 or queuecusto0_.BK_BRNCH=127 and queuecusto0_.BUSNSS_LINE=112 or queuecusto0_.BK_BRNCH=122 and queuecusto0_.BUSNSS_LINE=112) order by queuecusto0_.CUST_IS_NEW desc, queuecusto0_.REASS_DT asc
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list