Why Hibernate came in to picture

Anybody tell me please, where exactly Hibernate is used..tell me about the mapping and .xml file in Hibernate

Questions by udayvkumar

Showing Answers 1 - 12 of 12 Answers

To make the application developemnt more productive. its saves development time and also mainly it deals with Objects(POJO) .
and .xml file is nuthing but mapping between database column and POJO variable.
you can easily switch the database like MySql to Oracle you need not to change any of your code... just you can change a simple dylect in cfg file of hibernate to oracle it works with no error.

  Was this answer useful?  Yes

To make the application developemnt more productive. its saves development time and also mainly it deals with Objects(POJO) . and .xml file is nuthing but mapping between database column and POJO variable. you can easily switch the database like MySql to Oracle you need not to change any of your code... just you can change a simple dylect in cfg file of hibernate to oracle it works with no error.

Addition to that we have visual paradigm tool which helps to create the object model.

The reasons are plenty,weighing in favor of Hibernate clearly.

-Cost effective.Just imagine when you are using EJBs instead of Hibernate.One has to invest in Application Server(Websphere,Weblogic etc.),learning curve for EJB is slow and requires special training if your developers are not equipped with the EJB know-how.

-The developers get rid of writing complex SQLs and no more need of JDBC APIs for resultset handling.Even less code than JDBC.In fact the OO developers work well when they have to deal with object then writing lousy queries.

-High performance then EJBs(if we go by their industry reputation),which itself a container managed,heavyweight solution.

-Switching to other SQL database requires few changes in Hibernate configuration file and requires least clutter than EJBs.

-EJB itself has modeled itself on Hibernate principle in its latest version i.e. EJB3 because of apparent reasons.

I think the answers above are a sufficient reason to understand, why hibernate? But don't get confused, when we are drawing comparisions between EJBs and Hibernate. They are not actually parallel technologies or competitors. In fact, they work in association with each other. I mean they compliment each other.

Hibernate is no solution for skipping EJBs nor do EJBs are for Hibernate. Hibernate is an ORM tool / technology, which actually aides the Java / J2EE / JEE 5 programming. But it would not eliminate the very reason of existence of EJBs. Rather, Spring Framework does it. So, EJBs (read J2EE) and Hibernate and JBoss forms a group and it confronts the other group, Spring Framework. And please don't get confused, which technology is competing with which.

Anyways, it is just a clarification for the detailed answers provided above.


regards,
Madhusudan.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions