Hibernate Pojo Generator generates all the Java code necessary to access a database via Hibernate Annotations (+ Spring) including JUnit tests (1 per table) that are able to run immediately without further customizations. Mostly tested with MySQL.
Moved to GitHub: https://github.com/wwadge/hbnpojogen