TO THE NEW Blog PAGES

Grails

Groovy Category Annotation

Annotations really provides a whole new view of programming things. Groovy also provides some of its own annotations one of them is Category. Lets take an example of using it. We create a IntegerUtil class and annotate it with Category. [java] @Category(Integer) class IntegerUtil { List<Integer> multiples(Integer upto) { (1..upto).collect {this * it} } } […]

Grails

Specifying default package for all Grails artefacts

Hi All, Today i found how to specify default package for all Grails artefacts, would like to share with you. By default when we create any domain, controller or any other artefact, It takes application name as default package. If you want to change that just define grails.project.groupId property in your Config.groovy. [code] grails.project.groupId = […]

Grails

Batch update performance enhancements using SQL withBatch()

Hi guys, Recently as part of a project, I had to populate a SQLite database with large amounts of data pertaining to a number of classes requiring more than 5000 inserts and updates per class. I created a new SQLite database using Groovy’s Sql class. The initial strategy involved creating prepared statements and executing individual […]

Grails

Grails Data Binding & criteria reuse

Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles […]