Hello,
Who as experience with hibernate (Relational Persistence for Java). What are
the advantages and what are the pittfalls.
http://www.hibernate.org/
John
simon.martinelli@gmail.com - 13 Oct 2006 11:38 GMT
Hi John,
Hibernate is currently the best OpenSource O/R-Mapping framework.
The advanteges are:
- good documentation and community
- open source = free
disadvantes:
- Session in View problem: http://www.hibernate.org/43.html
- As with any O/R-Mapping tool you have to know a lot of databases and
have good knowledge of the O/R-Mapper if you wan't to avoid suprises.
Sometimes a Framework such as iBatis or simple JDBC will be more
performant an have less pittfalls than a big O/R-Mapper.
Regards, Simon
gryphon_smg - 13 Oct 2006 17:51 GMT
Hibernate is a great tool for ORM and Object persistence. It will take
much of the tedium and boiler-plate coding out your application.
Specific advantages.
1. Do your Java code in a natural, object oriented fashion. You do not
need to make your objects look like relational tables.
2. Save and Retrieve whole object graphs, rather than having to
individually save each table-mapped object individually.
3. The easy stuff is relatively easy, the hard stuff is possible.
4. Hides the database from your application.
5. You get to 'Think in Objects', not in 'Relational Tables'
Problems and disadvantages.
1. You have to learn the mapping configuration pretty well, so there is
a learning curve. The docs and online community are pretty good here,
but it still takes a while.
2. Hibernate pushes the JDBC driver pretty hard. If you are using a
poorly implemented, non-complient driver (Like IBM DB2/ AS400 /
iSeries) it will not work in the 3.1, 3.2 release. This proble also
affects other tools like DbUnit as well.
3. Tuning the application is necessary.
I have found Hibernate to be one of the best, most useful pieces of
open source software available, but since we are stuck using the IBM
JDBC driver, it has been much more difficult than it should be.
scott
> Hello,
>
[quoted text clipped - 4 lines]
>
> John
Arne Vajhøj - 14 Oct 2006 03:02 GMT
> Who as experience with hibernate (Relational Persistence for Java). What are
> the advantages and what are the pittfalls.
>
> http://www.hibernate.org/
You don't need to give a link - it would be a fair
assumption all readers of this group has heard about
Hibernate.
Pro:
* It is widely used meaning that it is easy to get
people with knowledge about it
* If you do everything the Hibernate recommended way
then it is easy to use
Con:
* If you need to twist Hibernate to fit an existing
DB structure then it can become hard work
* Performance is not always good (compared to
raw JDBC)
Arne