Take the 2-minute tour ×

I am doing some research on Grails and writing about what the future holds for it..

Something interesting jumped out in the RoadMap (http://grails.org/Roadmap)


Anyone with more experience with Grails than me know what this would entail?

I am guessing some sort of CRUD operations through Web Services instead of using Hibernate to connect to an SQL database?

share|improve this question
add comment

4 Answers

up vote 8 down vote accepted

there is a JSON RESTful API for GORM which gives some insight on what GORM for REST is like:

  • GET on /context/api/domain-class-name returns a list of domain objects (possible arguments are the same as for the DomainClass.list() method argument map)
  • POST on /context/api/domain-class-name creates a new instance
  • GET on /context/api/domain-class-name/id retrieves the given instance
  • PUT on /context/api/domain-class-name/id updates the given instance by ID
  • DELETE on /context/api/domain-class-name/id deletes the given instance

As far as to RESTy GORM that is scheduled for Grails 2.0, here is the GORM Virtual REST domain objects discussion on Grails mailing list:

I am currently evaluating the use of grails to connect to other backend systems. Would it be possible to let the domain layer talk to CRUD REST services instead of a Database? It would be a bit like a XML backend.... We have got a very big backend where it is difficult to implement business logic, but we can manage to provide restful services. My idea is to have grails as a business / web application layer on top to deploy various systems to cross platform

This feature is scheduled for development for Grails 2.0 
-- Graeme Rocher
share|improve this answer
add comment

I think the intent is to apply the scaffolding pattern to a RESTful API out of the box. There has been a JIRA entry around for several years for this.

Resulting JIRA: http://jira.grails.org/browse/GRAILS-2823

I also wouldn't be surprised if they took the dynamic finder idea and applied it to URL patterns.

GET /book/findByTitle/Dune


GET /book/findByTitle?title=Dune&format=json

or something like that.

I don't know exactly what is on the roadmap, but I imagine that the final product will have scaffold functionality (list,view,create,update,delete) through a RESTful interface plus some URL patterns that correspond to what you can currently do with the dynamic finders that GORM provides.

share|improve this answer
add comment

Take a look at the JAX-RS plugin. I suspect that will be the kind of thing they use.

share|improve this answer
add comment

Not that I want to rain on the parade but why would I use REST for accessing database rather than directly through hibernate. It's bound to slow down the DB access.

share|improve this answer
Because you may not own the database, only a restful interface into it. Consider the power of this when building a "mash-up" application –  J Jones Nov 22 '12 at 1:31
add comment

Your Answer


