6

I am coming back to Java from Ruby and ActiveRecord and want to use something as easy as ActiveRecord in Ruby. What options do I have?

yazz.com
  • 57,320
  • 66
  • 234
  • 385
  • 1
    You can check this : http://stackoverflow.com/questions/610590/is-there-a-java-implementation-of-the-activerecord-pattern-that-is-built-on-top-o – Colin Hebert Sep 22 '10 at 17:24

4 Answers4

7

There is a project that a colleague recently released called ActiveJDBC that is an implementation of ActiveRecord for Java.

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
Larry Smithmier
  • 2,711
  • 2
  • 23
  • 30
  • Actually I have used active jdbc. Quite good, except that it needs a precompile stage to add annotations to all the classes representing the models. Another problem is that not many large scale projects using it in production. – yazz.com Oct 05 '10 at 05:56
  • 2
    Zubair, ActiveJDBC needs a post-comlile step, not pre-compile, and it takes a fraction of a second to do this – ipolevoy Jan 12 '11 at 17:00
3

It'll probably some sort of Object Relational Mapping framework you end up using. Grails (a Java Rails like framework) has GORM:

http://www.grails.org/GORM

If you're not using a web framework like that then it'll prob. be some sort of ORM framework - Hibernate, OpenJPA etc...

http://www.hibernate.org/

If you don't want to do the full heavyweight ORM way then look at something like MyBatis (used to be iBatis) which has SQLMaps:

http://www.mybatis.org/

Jonathan Holloway
  • 62,090
  • 32
  • 125
  • 150
3

Hibernate provides very nice ActiveRecord-like access. There are tools to reverse-engineer models from the database. I keep it simple and it works well for me.

Tony Ennis
  • 12,000
  • 7
  • 52
  • 73
1

I like JPA myself (Java Persistence API). Easy to configure and with the right tools you can generate the database from classes or generate the classes from the database. It's easy to configure your classes with the annotations that you can use.

I use the OpenJPA implementation myself.

Mark Baijens
  • 13,028
  • 11
  • 47
  • 73