[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4109?page=c...
]
Shawn Clowater commented on HHH-4109:
-------------------------------------
I'll save you some turnaround, the first thing anyone is going to ask for is a test
case illustrating the problem. You should be able to modify the existing filter test
cases.
The one thing that confuses me is that for the two deleted checks, one is 0 and the other
is 1. Does the user id (0) get set as the value for the filter parm there?
filter and join "with" do not work
----------------------------------
Key: HHH-4109
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4109
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6GA, MySql
Reporter: ggsoft(a)gmx.net
Priority: Blocker
When using filters and joins with a with clause, Hibernate applies the parameters in
wrong order.
<property name="defaultFilterCondition"
value="deleted=:p_deleted"/>
The filter sets only a soft delete flag. On the HQL
select u, b. as buddyState from User as u left join u.buddiesForUserB as b with
b.userByUserA.userid = :p_userAid where u.username = :p_username;
the filter is applied to the with and to the where clause. Resulting in:
...
buddiesfor1_ on user0_.userid=buddiesfor1_.userB and buddiesfor1_.deleted=0 and
(buddiesfor1_.userA=0) where user0_.deleted=1 and user0_.username='myUsername'
...
because the order is filter, param,filter, param
But in Hibernates QueryLoader Class bindFilterParameterValues l.496 (511-516) it is
assumed the filters come first.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira