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 example of where exists 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 "example of where exists" Watch "example of where exists" New topic
Author

example of where exists

Franck McGeough
Greenhorn

Joined: Oct 27, 2005
Posts: 26
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

Joined: Oct 27, 2005
Posts: 26
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 :
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: example of where exists
 
Similar Threads
Example of Reflexive composition relation.
Association problem in delete
retrieving object hierarchy - many-to-one?
SQL puzzle about removing duplicate rows
Conditionalize popup menu for each node in JTree