Grails – query or criteria against a string/value pairs map property

April 21, 2014 at 10:35

Grails gives the possibility of creating simple key/value map properties as a Map of String to String, but the documentation doesn’t show how to query by this type of properties.

This post illustrates how to query the domain class using the map property as part of the query (i.e adding a condition for the key X to have the value Y) using HQL.

Grails – my domain class instance says its class is abstract!

November 18, 2013 at 09:56

Solution to the Grails problem when a domain class claims to have an abstract class as an effective class (i.e using getClass() and domainClass.class returns an abstract class) by removing the Hibernate proxy of that certain instance

Grails – Quickly examine a domain class associations

July 30, 2013 at 09:00

When your Grails model gets a bit complex, you may find yourself with conflicts in your domain classes associations (I like some parts of GORM, such as dynamic finders, but I think the relationships stuff could be improved). In my case, I usually end up finding problems when I mix […]

Groovy – Simplest way of resolving a nested property

July 24, 2013 at 09:00

So let’s say that in Groovy you find yourself wanting to do something like this: [ ‘name’, ‘lastName’, ‘address.street’].collect { propertyToResolve -> [(propertyToResolve): user[property] } You will find that the automatic getter (using it with the map syntax or as a property doesn’t change anything) won’t parse the argument to […]

Grails – publish a plugin in a self-hosted maven repository

June 10, 2013 at 10:08

Introduction and usage example of Grails Plugin Maven Deployer, a small scripting tool I created. The tool allows you to publish a plugin in a self-hosted maven repo by packaging it as a JAR file.

New Grails plugin – Timestamped

June 3, 2013 at 09:46

A Grails plugin to inject the auto-timestamp properties using a configurable, joda-time compatible AST transform that can be used both by a project and by other plugins.

Grails – small and simple method to convert objects to JSON

January 12, 2013 at 11:03

I was playing around with Grails and JSON and came up with a small method to convert a given collection of objects into JSON (typically, domain class objects, but it would work with anything). It’s nothing new or fancy, but maybe usefull for anybody who is starting to explore Grails […]

Bash – find directories of certain sizes

January 11, 2013 at 14:49

I often find myself trying to know which directories are consuming most of my persistent memory (I would say hard disk, but it isn’t a disk – and probably, even hard – anymore), and always get disappointed with myself for not being able to remember the way to do it […]