It is often said when unit testing to dont test the database as that is an integration test
(see point 4).
However, SQL/JPQL/HQL encapsulate data store specific
logic which is often in string format on how to access data. This free form string data access command can easily go wrong and hence needs to be tested.
How do i efficiently test this sort of logic?