views:

274

answers:

2

Hi,

I like Groovy/JRuby simplicity. But in order to use it, i would like to know whether Hibernate ORM framework works same way as in Java language ? Is there some limitation or restriction ?

regards,

+2  A: 

I don't know much about JRuby or Ruby, but the Grails GORM is built on top of regular hibernate. If you can't do something in GORM you could manually configure the underlying Hibernate layer with XML, the old way. GORM simply abstracts it one step further and uses convention over configuration to make less configuration work.

Sean A.O. Harney
Your way of describing hibernate sounds like it's not 'convention over configuration'. Just because the manual explicitly doesn't mention this buzz doesnt mean its not true. :)
Schildmeijer
+2  A: 

There is a nice JRubyexample here that shows a ruby closure using hibernate. I think that at least proves that you can use hibernate in JRuby as if it were plain old ruby.

In both JRuby and in Groovy, your classes will become java classes at run time. They can use Hibernate in the exact way that any java does.

Assuming your existing hibernate code is in java, there will be no restrictions. If you want to write your domain and dao in JRuby; you might have some minor issues. I don't think annotations or generics will work, at least not in an obvious way. I don't think that's a problem with Groovy as of the 1.6 release.

sal