jump to navigation

Hibernate

Hibernate provides support for collections and object relations, as well as composite types. In addition to persisting objects, Hibernate provides a rich query language to retrieve objects from the database, as well as an efficient caching layer and Java Management Extensions (JMX) support. User-defined data types and composite primary keys give additional flexibility to support legacy applications.

Hibernate is released under the Lesser GNU Public License, which is sufficient for use in commercial as well as open source applications. It supports numerous databases, including Oracle and DB2, as well as popular open source databases such as PostgreSQL and MySQL. An active user community helps to provide support and tools to extend Hibernate and make using it easier.

Hibernate uses runtime reflection to determine the persistent properties of a class. The objects to be persisted are defined in a mapping document, which serves to describe the persistent fields and associations, as well as any subclasses or proxies of the persistent object. The mapping documents are compiled at application startup time and provide the framework with necessary information for a class. Additionally, they are used in support operations, such as generating the database schema or creating stub Java source files.

SessionFactory created from the compiled collection of mapping documents. The SessionFactory provides the mechanism for managing persistent classes, the Session interface. The Session class provides the interface between the persistent data store and the application. The Session interface wraps a JDBC connection, which can be user-managed or controlled by Hibernate, and is only intended to be used by a single application thread, then closed and discarded.

Comments»

1. Vishwas Sinha - October 5, 2006

Question:-Why to use Hibernate

Answer:-Hibernate is generally used to avoid the impedence
mismatch between Relational database and object
oriented application.

2. sreenivas dronadula - October 24, 2006

ORM(Objest RelationalModel) tools like Hibernate,ToopLink are used to reduces the total ammount of time that we need tospend in developing the code to accessthe database

3. ravindra chowdary - April 17, 2007

Hibernate is used to interact with the database.We can do thge transactions easily in the hibernate.we no need to give lot off information that u have given ejb.That to less files are required to deal with Hibernate.pojo class,hbm.config.xml
hibernate .xml
we can reduce the complexity of querys by using the hibernate query language