wood burning stoves 2.0*
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
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 :
 
Consider Paul's rocket mass heater.
 
subject: example of where exists