Introduction to Hibernate


Introduction to Hibernate

 

Hibernate is a Mapping technique used in JAVA. There are several persistent frameworks such as Java Data Objects, TopLink, Entity Beans, Enterprise JavaBeans, Castor, Hibernate, etc. Hibernate is one of them. Hibernate is an Object-Relational Mapping (ORM). It is an ORM tool that automatically maps your domain object (java classes) to the relational databases.

 

What is ORM?

•    ORM is a data mapping technique. The ORM stands for Object-Relational Mapping.

•    ORM In computer software is a technique for converting data between system and programming languages.

•    It is an easy technique through which data in relational databases get converted to OOP languages.

•    There are several persistent frameworks and ORM’s in Java and hibernate is one of them. There are free as well as commercial packages available that perform mapping (Object-Relational Mapping).

•    ORM is a popular and powerful method of designing database and querying database at conceptual level, so that application described in terms easily appreciated by every user (technical as well as non-technical users).

•    Advantages of ORM are: it hides details of SQL queries from Object Oriented (OO) logic,  and here you need not to implement database, Fast development of applications.

Let’s something get to know about advantages and disadvantages of Hibernate.

 

Hibernate

 

Some Advantages Of Hibernate:

 

Performance:-

Hibernate is a lean framework oriented towards performance. It does not try to do too many different things; instead it focuses on doing one thing well.

Works using only reflection:-

Hibernate uses reflection to obtain information about an object, and data from an object. There is no modification of the object via some hibernate tool.

 

Efficient use of JDBC:-

It makes extensive use of advanced JDBC features to assure maximum JDBC-SQL performance.

Popularly used:-

Hibernate is the most used open source persistent framework and has been adopted by several other open source projects, so Hibernate very widely used.

Better than Plain JDBC(Java Database Connectivity):-

Hibernate automatically processes SQL statements that save time of a developer. Hibernate will save all tedious efforts such as setting parameter, executing a query therefore it saves developer’s time.

Integration with other frameworks:-

As Hibernate works well with other application frameworks, in particular it works very well with the spring framework.

 

Disadvantages :

 

Mapping granularity:-

Some elements of Hibernates level of mapping are not fine grained enough.

Lazy loading:-

By default, Hibernate uses a Lazy Loading strangely when restoring persisted objects. That is, Hibernate loads a single entity instance if you retrieve it by identifier through get () or load ().

Lack of support tools:-

Hibernate is an open source software project supported by JBoss. As such, it does not include a rich set of GUI-BASED based mapping or support tools.

Debugging:-

Sometimes debugging and performance tuning becomes difficult.

Difficult to manage lots of XML files:-

A change to a Java class may lead to a change in an associated XML file. It is easy to miss these changes or to produce very many different (and small) XML classes.

Poor error messages than commercial tools:-

Hibernate is not a commercial tool; it is just an open source and thus some for the refinement that goes it commercial tools lack in it.

Slower than JDBC:-

Hibernate is slower than JDBC because unnecessarily it creates multiple numbers of SQL statements.


About Dhiraj Disale

Hello Friends,I'm Dhiraj Disale,The One Of The Parter(Owner) Of This Website. This Website Is Totally Based On Whats New In Technology ......... So Stay Connected With This Amazing Website............. Thanx...... :-)

Leave a comment