Wednesday, April 20, 2011

Hibernate

Hibernate is an ORM (Object Relational Mapping) library for Java & its free.
Hibernate is Generally Divided in following parts :-
1. Mapping
2. Persistance
3. HQL (Hibernate Query Language)
Let us see some details about each part of Hibernate.
1. Mapping :-
Hibernates came in picture due to the mapping between the Java Objects & the Database Table Mappings.
This mapping is accomplished through the configuration of XML files or Annotations. Hibernate can use the XML file / Annotations to maintain the database schema.
2. Persistance :-
Hibernate provides transparent persistance for POJO’s Collection of data objects are typically stored in Java collection objects such as List, Set. Also cascade operations also supported.
e.g. Parent table deletion or save also affects the child table.
3. HQL :-
The HQL’s are approximately similar to the plain SQL’s not much difference.
One alternaive way is also available to HQL is Criteria, its totally object oriented.

No comments: