Grails Cookbook - A collection of tutorials and examples

Grails Criteria Count Example

This post will show how to get the total number of result with GORM criteria by using the count aggregate function inside criteria projections.

Grails Criteria Projections Examples

We could use Grails criteria projections when we want to select which properties or column to include in the query result. This post will show examples on how to use projections when working with Grails criteria to search for records in the database.

Grails HQL Order By Examples

This post will show how to perform HQL Order By in your Grails applications.

Grails HQL Group By Examples

This post will show how to perform HQL Group By in your Grails applications.

Grails HQL Pagination Examples

This will show examples on how to perform pagination with Grails HQL. A domain's executeQuery method can be used to invoke HQL commands and add pagination logic.

Grails HQL Delete Examples

This post will show how to use delete records on a database table using HQL. Using Grails HQL delete is important on some cases because it is a very efficient solution. Bulk delete can be finished in one go using just one JDBC call.

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 chained select - load data on one dropdown box depending on another

This tutorial will show how to create two select boxes where the second select box's items are affected by the value of the first one. Developers encounters this commonly and it is also called chained select. An example is selecting a country, followed by selecting a state. The choices for states should be based on which country was selected.