Anybody using ColdBox With Groovy or Java for Domain Models

Is anybody developing coldbox apps and building their domain models in
java or groovy?

if you are, can you please contact me.


Java or Groovy objects are strongly typed objects which would be bit difficult for cf-developers.

Secondly developers needs to know/learn about java.lang.Comparable, interface implementation of POJO objects, also persistence would be another issue.

As proof of concept I can try to integrate GORM (Groovy + Hibernate) which have kind of active record implementation.

we can generate POGO objects from xml notation, which will hide complexity of Java.

Here is very simple example of blogpost GROOVY domain class
class Blog {
String title
String body
String email

static constraints = {
email(email:true, nullable:true)

If anybody have any cool ideas, Please let us know.


I think that is a pretty cool idea! It would be great to be able to take advantage of GORM via ColdBox if at all possible as it then provides a complete Grails style stack based on Hibernate without having to leave the CF world. I’m guessing you might want to make it optional, but I’d certainly love if there was any way of getting hibernate without having to wait for centaur!



What do you think about this syntax for domain classes

if this is easy enough then I will write coldbox GORM loader and
hibernate will be on the way.

In CF like this,
User.setLastName('test'); etc

may be like this as well ClassPopulate('User', forms/url etc
getCollection()); everything will be done on coldbox end

Generating groovy domain classes from xml, could be bit tricky but

Looking forward to your opinion.


I'm planning on trying this with CFGroovy. Unfortunatley I have to
finish some actual work before I get to implementing this. But a new
coworker has some experience with Groovy and so I'm going to pick his
brain and use him as a resource while I try it out for my domain


That seems great Sana,

maybe we can create an ORM helper or plugin that can abstract these interactions with any future ORM. Please go ahead with it and post your progress and ideas so we can all contribute.


This would be awesome! I think if you could model your domains in
groovy and use GORM you would basically have Grails like framework.
The great thing about groovy domains + GORM is how extremely easy it
is to model your domain. Then you can set some constraints and you can
easily check those constraints before saving. Take the following
example of a blog post in a blog application.

class Post {

    String title
    String teaser
    String body
    String alias
    Date posted
    Date lastModified
    Integer views = 0
    Boolean released
    SortedSet comments

    // a post has many comments
    static hasMany = [comments:Comment]

    // table constraints
    static constraints = {
        posted(blank:false,min:new Date())


Now in our controller we can do this
    def update = {
        def postInstance = Post.get( )
        if(postInstance) {
   = params
            if(!postInstance.hasErrors() && {
                flash.message = "Post ${} updated"
            else {
        else {
            flash.message = "Post not found with id ${}"

And obviously we can do the same in our coldbox controller. I just
love this approach because its very easy to follow. I would love to
help out with this as I could see myself using this tomorrow!

Thanks Dan,

I know Sana is working hard on getting started on the integration. We will then see what kind of plugin or extension point we need to build to continue. But the best way to help out is to post here with ideas and talk to Sana.



Please feel free if you need any help or event help just testing the
Groovy + GORM stuff Sana