]
ggsoft(a)gmx.net commented on HHH-4109:
-------------------------------------
I have added a running example that demonstrates the behaviour. The value of the user id
(1) gets set for the filter that should be false/0.
The example is an eclipse maven project with hsqldb.
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
Attachments: HHH4109.zip
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: