CHAPTER 12The Data Layer

Most applications that store data use a database. Object-relational mapping (ORM) libraries relieve programmers from having to work directly with SQL and tables and enable them to work with objects instead. ORM libraries take care of mapping objects, their properties, and relationships to tables and columns and generate the required SQL for querying and performing CRUD operations on them.

Grails uses Hibernate (, the most popular ORM library for Java, under the covers as an ORM tool. Given the dynamic nature of Grails and its adoption of convention over configuration, it builds on top of Hibernate a new implementation called Grails' object-relational mapping (GORM) that simplifies working with ...

Get Groovy and Grails Recipes now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.