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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets 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 :
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
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