Grails Cookbook - A collection of tutorials and examples

Groovy List To String

Often times we need to concatenate items of a list to form a String. For example, a comma separated String. There is a nice trick in Groovy on how to convert a Groovy List to String.

Groovy String To Integer

Here are different examples of how to convert a Groovy String To Integer.

Groovy -e Command Line Option

This post will show how to use Groovy's -e command line option. The Groovy command line tool provides an interactive console to help you learn the Groovy Language. The Groovy -e option is very useful as it gives a quick way for executing simple Groovy scripts.

Groovy Each Loop Examples

This post will show examples on how to use Groovy each() to iterate through objects in a collections.

Grails findAll Tag Examples

This will show examples on how to use the Grails findAll tag(<g:findAll>). This tag is similar to each tag and uses the Groovy JDK findAll method to iterate over each element of a collection and only renders the body if the attribute "expr" is evaluated to true.

Grails join Tag Examples

This will show examples on how to use the Grails join tag (<g:join>). This tag utilizes the Groovy join method to concatenate the toString() representation of each item in a list or collection. A custom separator can also be used for this tag.

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.