I like to use a in memory hsqldb for testing. The process for each hibernate POJO is:
- Create the object
- Persist it to the DB
- Clear the session
- Get it from the DB
- Assert the objects are equal.
For DAOs, I create and persist enough objects to accurately test the methods, then run the tests and delete the objects as necessary to not intefere with other tests.