A thing I was playing with today was many-to-many relationships in Grails to create a Tag Cloud. To create a Tag Cloud, I must have a set of key/value pairs, each with a label and a value of the label, which could look like this:

['Java': 5, 'Grails': 16, 'Groovy': 12]

But to query this, I need to query a many to many relationship and produce the above result. This blog will describe how to do this with HQL, Criteria and the HibernateCriteriaBuilder.
(more...)

Grails Syntax Highlighter Plugin Released

Posted by Erik Pragt at around evening time: May 20, 2008

Grails syntax highlighter plugin

Yesterday, I released my first plugin for Grails. The goal of the plugin is to do Syntax Highlighting for Code Snippets in HTML pages, for which no plugin existed yet. The plugin supports a whole range of languages, and even includes Groovy Highlighting support. The Grails Synax Highlighter builds on the great work of Alex Gorbatchev, who wrote and maintains the Javascript Syntax Highlighter.
(more...)

Helpful error messages in Grails

Posted by Erik Pragt around lunchtime: May 4, 2008

Currenttly, I'm in the process of building a Grails application. While I've built several prototypes/quick hacks, this is actually the first 'real' application I'm building. "So", I thought, "if this is a real application, I'm in need of some real tests!". When you're in the normal flow of developing a Grails application, everything goes so fast, you almost forget about writing the tests. So I decided to do it a bit differently, and do it just like in Java: do it TDD!
(more...)

Video Podcast Episode 6 - IntelliJ and Grails

Posted by Robert van Loghem mid-afternoon: April 23, 2008

Erik Pragt shows you in this silent but excellent Screencast how to use Grails in the IntelliJ IDE.

So head on over to the show page or subscribe to our podcast!

JavaOne 2008 Scripting preview

Posted by Jeroen van Erp at around evening time: March 13, 2008

The biggest Java event of the year is coming up again, the JavaOne. For me this is a place of inspiration. Seeing the newest technologies in action and talking to some of the great minds in the Java world, how can one not become inspired!
(more...)

Tutorial: Master-Detail screen in Flex, backed up by Grails application

Posted by Maarten Winkels in the early afternoon: February 20, 2008

In this blog I will show how to create a simple Master-Detail screen in Flex, how to back it up by an application is Grails and how to publish changes via JMS to all Flash clients. Important topics will be binding and remote java-object invocation in Flex and configuring JMS.

A Master-Detail view is a view with a master list, showing a collection of items and a detailed view, most often consisting of a form, in which the a single item can be edited. Clicking an item in the master list will display the details in the detail view.
Master-Detail

The combination of a framework for building RIA's (Flex) and a Java based dynamic framework for building services (Grails) seems very promising. I think the high productivity that can easily be achieved by this combination will make it a very attractive choice for your next big project.

(more...)

Advanced Hibernate, Maps Part 1: Complex Associations

Posted by Maarten Winkels mid-morning: October 22, 2007

When it comes to using Hibernate, most projects only use the very basic features. This is mostly due to naivety or unfamiliarity with the product. Hibernate is a very mature and feature rich product that can be used to solve a lot of basic or advanced problems. I think the point here is to put the complexity at the right level: You can always take a very basic approach to using Hibernate and solve the mismatch between your mapping and your model in your model, but that would put complexity in your model that is basically boilerplate code. It is only there because the persistence layer is not used correctly. If you make the persistence layer (in this case the Hibernate mapping) more complex it will be harder to maintain, but your model code will be more concise and easier to understand.

One of the features of Hibernate that is hardly ever used, but has some very interesting applications is the ability to map java.util.Maps. This blog will show an application of using a Map in your model and mapping that model with Hibernate to a Relational Database Schema.

(more...)