Dependency management in Grails 1.2

Sometimes I get the impression that there are many Maven haters in the Groovy/Grails community – now with version 1.2 of the Grails framework they are able to abandon the evil satanic Grails Maven Plugin and embrace the neverending joys of a slim, nice, sexy dependency resolution dsl .. here we go .. lets define some dependencies wheee … Our dependency configuration is defined in grails-app/config/BuildConfig.groovy as a property named grails.project.dependency.resolution: grails.project.dependency.resolution = { // here will be some dependencies } ...

May 23, 2010 · 2 min · 336 words · Micha Kops

Named Queries in Grails 1.2

They built a nice new feature in Grails 1.2 called “named queries“. Named queries can be defined in a domain class as static properties and support the criteria builder syntax. Examples package testapp class User { String name int iq int age static namedQueries = { dumbUsers { int referenceIq = 60 lt 'iq' , referenceIq } nameStartsWith { letter -> like 'name', '${letter}%' } midAges { between('age', 20, 40) } } } // count dumb users println User.dumbUsers.count() // print amount of users, usernames starting with an 'a' User.nameStartsWith('a').count() ...

April 6, 2010 · 1 min · 111 words · Micha Kops