wood burning stoves*
The moose likes Object Relational Mapping and the fly likes Use of Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Use of Hibernate" Watch "Use of Hibernate" New topic
Author

Use of Hibernate

Gajanan Bandale
Greenhorn

Joined: May 09, 2005
Posts: 22
Hi Friends, Here, I want to know one basic thing about Hibernate.
1) Why Hibernate?
2) What is the need/use of Hibernate in Project?
3) In which condition we use Hibernate?
4) Is it the replacement of JDBC or EJB (Entity Bean)?
5) Exactly where we use Hibernate?

Khadija Lokhandwala
Ranch Hand

Joined: Sep 11, 2007
Posts: 33
Hibernate is
1.A ORM Tool
2.It saves you from the database mapping as in EJB 2.0 by just deefining the table structure in .xml files.
3.Can be used whenever you need to work with database.
4.Has its own query Language (Hibernate Query Language) which makes it easier to fetch data.


If you ask me anything I don't know, I'm not going to answer.<br />--Yogi Berra
Gajanan Bandale
Greenhorn

Joined: May 09, 2005
Posts: 22
Originally posted by Khadija Lokhandwala:
Hibernate is
1.A ORM Tool
2.It saves you from the database mapping as in EJB 2.0 by just deefining the table structure in .xml files.
3.Can be used whenever you need to work with database.
4.Has its own query Language (Hibernate Query Language) which makes it easier to fetch data.



Thanks Dude!!

Actually i know Hibernat little bit also i have some hands on experience with Hibernate coding but actually i want to know that

What is the need of Using Hibernate? I mean to say we use JDBC for connection, they what about Hibernate? What is its role in any project? I would like to know about its Basic......... such questions like
What? Why? Where?


Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I'll pu tthis simply, because you can write a book answering those questions.

Why I use Hibernate over JDBC.

1. Easier to code.
2. Saves over 40% of JDBC code, which is a real pain to code to ResultSets and converting them into Java objects.
3. JDBC works with datasets, Hibernate works with Java Objects. (so to speak)
4. In some cases, Hibernate will be faster than JDBC, because of caching.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Muhammad Ghufran
Greenhorn

Joined: Jul 20, 2005
Posts: 8
The basic objective of Hibernate is to achive independence from database. You can writer yor datalayer and plug it with any Database liek Oracle , MySql, etc without changeing any code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of Hibernate
 
Similar Threads
EJB 3.0 and Hibernate
Hibernate 2: check if table exists and get the name of the table out of the class
use prefer or not
Use of Hibernate
Data Access Layer Best Practices