Hibernate is Object Relation Mapping (ORM) library made for Java and also available for .Net. It is a Open Source Project, Licensed under LGPL and component of JBoss Enterprise Middle Suite.
What is the need ? Applications on the Web or on the Desktop need to save data and retrieve data from the database. ORM is technique for converting data between Object Oriented Languages and Relational Databases. It allows developer to deal with data as objects, something they like doing to make reading and writing of data simpler. Tools have been developed which create Object Mapping automatically , making it easier and faster to develop applications. Using such tools also bring architecture uniformity.
Java Application connects to POJO objects. These POJO (hibernate) classes use configuration and mapping files written in XML and JDBC/ODBC drivers to connect and perform operations on a database.
Advantages
· Open Source.
· Widely Used and Mature with Active Community.
· Commercial Support Available for Jboss.
· Flexible , Easy to Learn and use.
Features
· Persistent Classes follows Object Oriented Paradigm.
· Express Query in SQL(Structured Query Language), HQL(Hibernate Query Language) or Native SQL.
· Access data using Use POJO(Plain Old Java Objects).
· Can execute inside or outside a container. Application Server is not required.
· Perfect solution of Application which can be Web or Desktop.
· Application code is database independent. Until of course you use Native SQL
· Configurable by using XML File.
· Can be used with or without database.
· Scalable and works in Clustered Environment.
· Smaller memory footprint
· Ability to use Native SQL helps in improving performance.
· EJB3.0 is similar to hibernate 3.0 making it easier to migrate.
Limitations
· Does not do automatic instance pooling.
· Does not have locking or synchronization for data.
· Relies on database management system to deal with concurrent access.
· Heavy use of Java Reflection is less of a performance issue, due to improved JVM.
· Stored Procedures need to return a value , if multiple values are returned first one is selected
· Any modifications to the database require regeneration of code, potentially wiping your changes.
· Mapping of Old or Complex databases where the tables have composite keys, and data is spread across tables with different keys is difficult.
In Conclusion it is a great tool which can be used for mapping databases, saving and retrieving data, in simpler faster way with ability to write the Native SQL if performance is needed.
0 Comments:
Post a Comment