-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: HQL delete with inner joins?
PostPosted: Tue Jul 15, 2008 2:03 pm 
Newbie

Joined: Tue Apr 25, 2006 1:17 pm
Posts: 19
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.