Grails Cookbook - A collection of tutorials and examples

Grails HQL Update Examples

This post will show examples on how to use Grails HQL Update operations on a database. Using Grails HQL for bulk update operations is very efficient because a task can be completed in one go.

Grails HQL Count Examples

This post will show how to use the COUNT aggregate function inside Grails/GORM HQL statements. Just like in SQL, HQL COUNT statements returns the number of rows that matches a specified criteria.

Grails HQL Join Examples

This post will show how to perform HQL Joins with one to many relationships and other cases. Joins are important when you need to check two or more tables to retrieve the required information

Grails Domain createCriteria Examples

This will show how to use a Grails domain's createCriteria method to search for records in the database using the criteria API.

Grails Domain executeQuery Examples

This will show how to use a Grails domain's executeQuery method to search for records in the database using HQL.

Grails Domain executeUpdate Examples

This will show how to use a Grails domain's executeUpdate method to update or delete records using HQL.

Groovy Map Tutorial

Maps are very useful when coding in Groovy. This tutorial will show the different ways of using a Groovy Map.

Grails Domain count and countBy Examples

This will show how to use a Grails domain's count and countBy methods.

Grails Tutorial for Beginners - HQL Queries (executeQuery and executeUpdate)

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.

Grails Tutorial for Beginners - Criteria API

This tutorial will show how to use Criteria API to search data from the database. Criteria is a powerful API and an elegant alternative to HQL.