Unit Test Hibernate – DAO Layer with Spring & HSQLDB

Step 1: The pom.xml file with test jars, Spring jars, and hibernate jars

Step 2: The HSQL DB schema and data scripts in the src/test/resources folder.

sql/schema.sql

sql/data.sql

Step 3: The Spring configuration for the unit tests in the src/test/java folder.

Step 4: The Spring configuration for the entity manager and datasource.

Step 5: The Hibernate entity class

Step 6: The Dao interface and implementation class

Step 7: Th unit test class to test the DAO layer with the in memory HSQLDB database.

The next post covers JPA, and entitled “Unit Test Hibernate – DAO Layer with JPA, Spring & HSQLDB“.


Categories Menu - Q&As, FAQs & Tutorials

Top