wood burning stoves 2.0*
The moose likes Other Application Frameworks and the fly likes hibernate doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "hibernate doubt" Watch "hibernate doubt" New topic
Author

hibernate doubt

sunitha chekuri
Greenhorn

Joined: Oct 20, 2005
Posts: 8
Hi,
In what kind of applications should we use hibernate.Could someone tell me its advantages.
I noticed in hibernate for each table in the database we need to have a an xml file and a Java POJO.Is it not an overhead?
I feel using JDBC to query the database more comfortable.But I might be missing something about it.I am new to J2ee technologies and have come up with this doubt when started learning hibernate.
Thanks in advance.

suneetha.
Wagner Danda Da Silva Filho
Ranch Hand

Joined: Mar 21, 2003
Posts: 80
Hi,

I see a simple advantage of using Hibernate (or any similar): you'll just work with objects in your code, the code looks cleaner.

Besides that, Hibernate does the hard work of persisting the objects (he does the inserts/updates/deletes for you).

Also, the part of creating the XML and POJO files is already automated by many tools (see Hibernate Tools for Eclipse).

The counterpart is if your app is too focused on database procedures, then I think you wont get too much benefits from Hibernaate.

[]�s
Wagner Danda


SCJP, SCWCD
sunitha chekuri
Greenhorn

Joined: Oct 20, 2005
Posts: 8
Hi Wagner,
Thank you for your response.I seem to understand it, but I may feel the difference when I really work on a hibernate project.

After I posted this I found a very well written Return on Investment article on hibernate.This is the URl.

http://www.jroller.com/page/gursesl/print/p_class_msonormal_span_style

Thanks,
suneetha
Levent Gurses
Greenhorn

Joined: Apr 08, 2002
Posts: 25
Sunitha,

While Hibernate is definitely a good option to research, you should know that it is not the only one. iBATIS for instance is another widely supported framework framework for Java and .NET. iBATIS couples objects with stored procedures or SQL statements using a XML descriptor. What it brings on the table is simplicity. Now, arguably Hibernate is also based on simplicity. So, do the research, run two small prototypes and see for yourself.

On the features side, with iBATIS Data Mapper, you rely on your own objects, XML, and SQL. So, it claims to give you greater power of both SQL and stored procedures for your business logic. Whether you want to put business logic on the data layer is another question that only you can answer.

Sincerely,


Levent Gurses<br />Jacoozi - New Generation E-Solutions for >> Thinking Companies<br /><a href="http://www.jacoozi.com" target="_blank" rel="nofollow">http://www.jacoozi.com</a>
Sabarish Sasidharan
Ranch Hand

Joined: Aug 29, 2002
Posts: 73
Originally posted by Levent Gurses:
Sunitha,
On the features side, with iBATIS Data Mapper, you rely on your own objects, XML, and SQL. So, it claims to give you greater power of both SQL and stored procedures for your business logic. Whether you want to put business logic on the data layer is another question that only you can answer.

Sincerely,


Sunitha, If you love SQL, comfortable with it, then use iBATIS. It is the simplest framework and is quite easy to get started with. When using Hibernate, expect a steeper learning curve.


Sab<br /> <br />Perfection does not come from belief or faith. Talk does not count for anything. Parrots can do that. Perfection comes through selfless work.<br />Swami Vivekananda
 
 
subject: hibernate doubt
 
Similar Threads
saveOrUpdate () doubt
Struts Doubt
doubt
Doubt Regarding Transaction and flush
include directive doubt?