Hi. I'm using Hibernate 3.0alpha and I'm a new to using Hibernate in general. Please excuse me if this is a FAQ. I looked around and haven't been able to find the answer so far. I'm trying to figure out how to delete all rows in a table.
It appears that this can be done using org.hibernate.classic.Session.delete(String query) to do this, but, this method is deprecated. It says in the API specification to use createQuery() to do this, but, I don't know how.
The other question that I have is, how to delete a Collection of objects? Do I have to iterate through the Collection and call delete() for each object? I was thinking that maybe I could just do a query for all rows in the table and then do a List.clear() and maybe it would delete the rows automatically...
|