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

6

5

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!

EDIT
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.

Amethyst answered 18/6, 2009 at 17:6 Comment(5)
What makes you think JackRabbit doesn't support annotations? Even the 5min tutorial uses them. jackrabbit.apache.org/5-with-jackrabbit-ocm.htmlImmobilize
Oh, thank you! I was primary searching for information about the JCR spec, not the Jackrabbit implementation.Amethyst
Hmm I'm not sure I understand what you want. The JCR 2 spec is jcp.org/en/jsr/detail?id=283. Do you want a ORM: en.wikipedia.org/wiki/Object-relational_mapping or a content repository?Immobilize
+1 since I hadn't heard of jackrabbit and it sounds like something i could use for one of my applications. Apache rules!Polysyllabic
@jitter: I want to store objects in a OOP way. With mapping or without.Amethyst
A
4

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.

Ammieammine answered 18/6, 2009 at 21:12 Comment(0)
W
2

Oracle Berkeley DB Java Edition

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

Wag answered 18/6, 2009 at 19:58 Comment(0)
C
2

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!

Corregidor answered 19/6, 2009 at 0:32 Comment(0)
M
0

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.

Macomber answered 18/6, 2009 at 17:32 Comment(3)
Does hibernate require a relational DB? I really would like to NOT take care of mapping object to tables and back.Amethyst
Ivan, do you mind to do a basic research yourself? Не нужно ждать, что всё тебе разжуют, и положат в рот.Macomber
You could use this argument for 90% of questions asked here. I needed a decision fast, bud had no idea about DB technology, so a asked.Amethyst
M
0

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.

Moten answered 18/6, 2009 at 19:6 Comment(2)
We had a fair amount of success with OpenJPAEndogenous
And I personally use Hibernate via JPA APIMacomber
B
0

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....

Blus answered 25/6, 2009 at 18:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.