Is it possible to do an inner join with same table with HQL on a delete?
In MYSQL, you can execute a query such as:
Code:
delete
t1 from table_name t1, table_name t2
where
t1.ID = t2.ID and
t1.OrganizationID = t2. OrganizationID and
t1.UserID = 17 and t2.UserID = 18;
When I try to setup the HQL as:
Code:
'delete from table_name t1, table_name t2
where t1.ID = t2.ID and t1.OrganizationID = t2. OrganizationID and
t1.UserID = :first_user and t2.UserID = :second_user'
I get the error, "java.lang.IllegalArgumentException: node to traverse cannot be null!" when the query is getting compiled..
Any suggestions?