I'm writing some integration tests for a Spring/Hibernate app I'm working on, and I would like to to test things with as close to real conditions as possible, which includes using Hibernate's second level cache and committing transactions.
I was wondering if there was an efficient way to ask Hibernate to delete everything from the database and the caches. The best I could come up with was using an HQL "delete from XImpl" line for every type of object, but I have a couple dozen domain objects, and it feels like there should be a better way.