Tutorial :Using which database technology could I persist objects? (Something that does NOT require me to take care of mapping objects to tables and back)?


I need to use an object oriented data repository for a project.
It's going to be something between a wiki and a CMS.

I'm not an expert in the field of persistence yet.
I suppose Hibernate and Jackrabbit are the frameworks to go, right?

As far as I'm informed correctly, Jackrabbit does not support
annotations or other convenience techniques for mapping
between object instances and data storage.

Hibernate, on the other hand, does not support versioning
out-of-the box.

What would you suggest me to use?
Could I in some way combine both these frameworks?

Could you also, if possible, summarize the pros and cons of the two frameworks?

Thank you!

I really would like to use something that does NOT require me to take care of mapping objects to tables and back. Why should I? In which century do we live? ;)

I had good experience with JAXB (mapping objects to XML and back in an object-oriented way), but JAXB has no use in databases.


db4o is an object oriented database. As it's OO you store the objects directly so you don't have to maintain any mappings to tables.


Oracle Berkeley DB Java Edition

Is a direct persistence layer (no mapping to a relational database).


Try NeoDatis. It's got all the goodness of db4o (native queries, no mappings, fast) except that it's completely free (even for commercial use).

UPDATE: Last time I tried NeoDatis (mid-2010) it still had some critical bugs. For example, power loss could result in database corruption. Beware!


I would go with Hibernate. Simply because it has so vast community. Yes, I have a lot of (good) experience with Hib personally, so I'm biased.

As for versioning, well, implement it yourself -- it's not hard, just make a copy (reflection is a helper), and save the object.


You could also look into using JPA's. While they aren't the hottest thing since sliced bread, they are being adopted by the Java community and are being pushed as the new standard by the Sun community. Hibernate is safe and proven though, so I personally am going to stick with it.


DB4o and Neodatis are the way to go...

I think that you'll need a commercial license if your project is for profit.... If so go with neodatis....

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »