Article:
 |
|
Hibernate Your Data
|
| Subject: |
|
Is it the best? |
| Date: |
|
2004-01-16 04:01:08 |
| From: |
|
fabiolourencetti
|
|
|
|
Is Hibernate the best free ObjectRelationalMapping tool? |
Showing messages 1 through 6 of 6.
-
Check out OJB
2004-01-16 13:53:19
jimothy
[View]
-
Re: Check out OJB
2004-01-16 13:58:42
anonymous2
[View]
-
Re: Check out OJB
2004-01-16 14:11:22
jimothy
[View]
-
Re: Check out OJB
2004-01-17 03:42:17
epbernard
[View]
-
Re: Check out OJB
2004-04-08 00:23:58
cgulcu
[View]
-
Is it the best?
2004-01-16 11:29:31
rmcodnough
[View]
The main reason I prefer OJB is its object-oriented querying mechanism, versus the HQL of Hybernate. If crafting SQL strings is a hassle, why is crafting HQL strings any better?
The example from the article, Find Orders within a price range, would look like this in OJB:
Adding additional criteria is simple. For instance, we may also want to query on orders with a certain product name, but only if the user entered such criteria on a form. With HQL, this would involve sometimes akward string concatenation, which is one of the things I like an O/R tool to help me escape! In OJB, you'd just have to write code like:
If you're familiar with Enterprise Object Framework (EOF, part of WebObjects), this style will be familiar to you.
OJB also supports ODMG and it's Object Query Language, as well as a reference JDO implementation. Frankly, I wish they'd drop both and focus on just the PersistenceBroker API (used above). A more focused approach would allow them to get OJB out of release candidate status and to a final release.
Check it out!