Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

example of where exists

 
Franck McGeough
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody give me a Hibernate example of delete "where exists" usage? The reference manual doc is pretty bad. I want to delete all the rows from a child table based on a criteria in the parent. Something like this:

 
Franck McGeough
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind. I figured it out. You can do it in HQL. (I'm using Hibernate 3.1 rc3). It looks something like this :



Hibernate generates sql that resembles the following :
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic