This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes hql delete join Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hql delete join" Watch "hql delete join" New topic
Author

hql delete join

siraj baig
Ranch Hand

Joined: Jul 11, 2006
Posts: 42
Hi,
I am able to delete records from a single table.
But when i try to delete from multiple tables using joins Hiberate throws
Exception:

Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: unexpecte d token: , near line 1, column 31

My Query: " delete from org.hib.Table1 t1,org.hib.Table2 t2 where ta.id = t2.id and t2.name=name "

Can you please tell me how to delete records from multiple tables using joins

Thanks
siraj.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: hql delete join
 
Similar Threads
JPA Question : Deletion w.r.t One-to-many relation
SQL question
Regarding join statement?
CMP and Multiple Tables
JPA JPQL - How to Order the Joins