aspose file tools*
The moose likes Object Relational Mapping and the fly likes Comparing Persistence Frameworks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Comparing Persistence Frameworks" Watch "Comparing Persistence Frameworks" New topic
Author

Comparing Persistence Frameworks

antonio bartulovic
Greenhorn

Joined: Feb 19, 2008
Posts: 3
Hey!

I am looking for an easy way to map objects in a huge database based on a jee applications. This JEE Application will supports Java1.5 and EJB3

My candidates are:
- pureQuery(tm)
- JDBC native
- Hibernate
- Spring

On my first web inquiries I saw that the newer hibernate versions are using simple annotiations, where a developer doesnt need to write XML files. Thats a pretty good thing. But which "Framework" is recommended?

PS: It is important to map several tables in one object!
[ February 19, 2008: Message edited by: antonio bartulovic ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Why didn't you also include Oracle's Toplink?

I am too biased, so I won't give my opinion, except to not use JDBC, to much code to write.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Oh, and Spring is not an ORM Persistence Framework. So you can still use Spring, with any ORM, so to speak.

Mark
antonio bartulovic
Greenhorn

Joined: Feb 19, 2008
Posts: 3
I am using DB2 Databases, is Toplink supporting these DBMS?

You're right about Spring. But it includes features for using ORM much comfortable.
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Originally posted by antonio bartulovic:
I am using DB2 Databases, is Toplink supporting these DBMS?

You're right about Spring. But it includes features for using ORM much comfortable.


Yes, like most ORM's TopLink also supports DB2.

Another question is why didn't you include JPA?

JPA is the standard for persistence in JEE and allows you to try different products out. I would recommend that.


-Mike
Pro JPA 2: Mastering the Java Persistence API
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

My vote is for iBatis.


GenRocket - Experts at Building Test Data
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Use Hibernate with JPA annotations.

Mapping one Java class across multiple tables is a lead pipe cinch. No problem at all. For multiple databases, you can use Hibernate Shards.

All the key frameworks work pretty good. Hibernate with JPA annotations is extremely easy, can work with an EntityManager, and has a very large basis of support.

It's a pretty personal decision though.

-Cameron McKenzie
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

I'd prefer Hibernate/JPA.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Since your application is going to support Java 5 and EJB 3, I think JPA is a clear winner.
iBatis is also a good candidate.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Antonio,

I'm just finishing up a book on Hibernate and JPA annotations. If you chose that direction, and you'd like a draft copy and be an editor, I'd more than welcome the help.

-Cameron McKenzie
antonio bartulovic
Greenhorn

Joined: Feb 19, 2008
Posts: 3
why not
just send it to me!

because i'm writing actually a genreal overview of just 3 technonolgys:

raw jdbc vs. or mapping (hibernate and purequery)

abartulovic@gmail.com

I'm also able to translate it into german
[ February 27, 2008: Message edited by: antonio bartulovic ]
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
Personally I would also recommend using JPA, as it has the most persistence products supporting it. Since JPA is just a spec, you will also need to decide on which JPA product to use, but the advantage of using the spec is that you can easily switch what product you use at any point.

Here is a link to a short list of JPA and persistence products,
http://en.wikibooks.org/wiki/Java_Persistence/Persistence_Products

In my extraordinary biased opinion I would recommend EclipseLink.


TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
Pj Murray
Ranch Hand

Joined: Sep 24, 2004
Posts: 194
Some items that might help

There's a blog posting with a comparison of Java persistence choices here:

http://www.codefutures.com/weblog/corporate/archives/2005/02/data_persistenc.html

Of course, you need to decide if you really want to use a mapping tool. You may find these blog postings on "DAO versus ORM" and "Choosing a Java persistence strategy" interesting:

http://www.codefutures.com/weblog/andygrove/archives/2005/02/data_access_obj.html


http://www.codefutures.com/weblog/andygrove/archives/2005/01/choosing_a_java.html



PJ Murray -
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Comparing Persistence Frameworks