You can either run single tests or if applicable groups of tests as a single transaction, and then roll back at the end. (This might be difficult if the tests themselves comprise multiple transactions and your db doens't support nested transactions or savepoints.)
Alternatively, have your test database created by scripts. DbUnit can help here, as can other database generators, such as LiquiBase, dbmaintain, dbmigrate You can then drop the entire database and recreate for each test or test group. The usefulness of this approach diminishes as the test dataset becomes large and overhead increases.
A final option is to not have your tests depend upon the generated id, since depending upon the generated value will create brittle tests. It's useful to test the generated id, so test these values for some tests, but I'm not sure there is value in testing the Ids for all tests.
EDIT: The OP asked about using hibernate to recreate the schema. This can be arranged by creating a new SessionFactory for each test and setting the "hibernate.hbm2ddl.auto" to "true" when building the SessionFactory. I mention the diminishing effectiveness of drop-create - it appies to this case too.