Hi.
I really like how ActiveRecord or SQLObject make my life more easy when it comes to ORM. Ok, they miss certain features Hibernate has (e.g. good support for mapping inheritance). But you don't have to write as much of redundant code as you have to do with Hibernate/JPA. They automatically create methods to manipulate your entity classes while preserving referential integrity.
I figured using a code generation library like cglib something similar should be possible with Java, too. I thought it would be nice to just annotate an interface or abstract class and the framework builds the implementing class (including methods like toString, hashCode and equals) on the fly. The implementing classes of annotations are built that way, so this should be possible!
I wrote a little proof of concept implementation of this. However, this implementation is not an ORM, it just implements the things Hibernate/JPA doesn't. And it most certainly could be implemented better (there is room fro optimizations, I didn't handle inheritance and so there are a few hackish bits, that will cause problems there).
I wrote a blogpost about this. You can see a short example and download the source there, too:
http://twoday.tuwien.ac.at/pub/stories/316042/
I'd like to know how others think about this. Is this something that users could possible want? I think it would be a very nice feature and it could be implemented in a way where it doesn't interfere with the current behavior at all. Using abstract classes you could also combine both ways!
-panzi