Showing posts with label rails. Show all posts
Showing posts with label rails. Show all posts

Friday, November 23, 2007

JRuby (and ActiveHibernate) at JavaPolis

It's nice to see that JRuby is getting the attention it deserves at JavaPolis:

And, while on the topic of ActiveHibernate, I have added support for lazy loading of entities and support for Hibernate components (aka aggregation in Rails):

class Address
attr_accessor :street
attr_accessor :city
end

class Person
include Hibernate
primary_key_accessor :id, :long
h_component :address,[[:street,:string],[:city,:string]]
end

I'll use the time that's left before JavaPolis to polish (i.e., clean up and extend the tests) the functionality that is in there today.

Anyway, I'm looking forward to meeting the JRuby team in Antwerp.

Tuesday, October 30, 2007

ActiveHibernate update

Just added basic many-to-one support in the mapping DSL. I still hope to have a JRuby on Rails application running with ActiveHibernate before Javapolis.


Update:I'll be doing a Javapolis Quicky on ActiveHibernate. In the meanwhile one-to-many (has-many in ActiveRecord speak) has been added to the mapping DSL example.

Wednesday, July 18, 2007

JRuby + Hibernate = ActiveHibernate?

A couple of months ago, Ola Bini coined the idea of ActiveHibernate as an extra option when running Rails on JRuby (complementary to ActiveRecord-JDBC). After some debug sessions through the Hibernate and JRuby code I have convinced myself that this is indeed a nice and feasable project to start (or try to, at least). As Ola mentioned there are two parts to this:
  1. Configure/tweak Hibernate to let it work directly with the org.jruby.RubyObject class. I'm already impressed by the clean internal design of the Hibernate code, and the possibility to plug in custom implementations of Hibernate interfaces through the hbm.xml mapping files.
  2. Provide a Rubyish interface to the Hibernate configuration and functionality, following the fine Ruby on Rails tradition.
Point one seems the hardest to me, as I would like to keep the number of changes to org.hibernate (and org.jruby) code very low. None if possible (?). For the second point, ActiveRecord, Grails' O/R mapper (GORM) and Hibernate Annotations can serve as examples to learn from. I'm also looking forward to IronRuby to see if it could be married to NHibernate in a similar way.

As soon as I have something up and running I'll post the code to SourceForge, or RubyForge, or ... What would be the most appropriate hosting site for this kind of project?