The database code can be kept clean and simple by using the DAO module.
This helps in preventing problems that rise because of poor handling of closures of database resources.
Also, the DAO module utilizes the AOP module to enable objects in the Spring application to use transaction management services.
https://www.digitalocean.com/community/tutorials/dao-design-pattern