This Grails tutorial will teach the basics of using HQL. Grails supports dynamic finders which makes it convenient to perform simple database queries. But for more complex cases, Grails provides both Criteria API and HQL. This tutorial will focus on the latter.
Scaffolding is a popular feature of web frameworks where a programmer can quickly create working components of a system to handle data manipulation. Code to handle create, read, update and delete operations (CRUD) for a specific table can be implemented or generated within several minutes only through the use of code generators or other shortcuts.
HTML Forms are usually used to gather data from users. This post will show how to make use of forms to save data to the database.
This example will render a form that looks like this:
And on click of save, will save the data to the person table.
GORM is half the reason why I use Grails as my default choice in implementing new projects. Using it just makes implementation of business logic a breeze. Working with a database becomes so easy.
GORM is Grails' object relational mapping (ORM) implementation, which sits on top of the very popular Hibernate framework. If you are familiar with Hibernate, then you can pick up GORM in an instant. Don't worry otherwise as GORM is straightforward and easy to learn.
When coding screens, there are many elements that are common and repetitive. Usually the header, footer, and sidebars stays the same and only the content at the middle of the screen that change. The best approach is to have your GSP page contain only the specific business content, and have the repeating content re-factored outside. Grails supports layout templates for this particular purpose.