1. Persistence Class:
The persistence class is a Plain Old Java Object or POJO model. A POJO is comparable to a JavaBean, having getters and setters to access its properties that are the instance variables. The persistence class has the following characteristics:
a. It is the Object Oriented blueprint of the table to be persisted.
b. The attributes of the table become the instance variable of the persistence class.
c. The data type of the instance variables is the domain of the attributes.
d. The object of the persistence class represents the row of the tabl
2. Mapping file: The mapping file is an XML file that contains detailed mapping between the persistence class and the table it represents. The required elements of this XML file are: a. hibernate-mapping: Hibernate-mapping is the root element enclosing all other elements. b. class: Class is used to map the table name to the persistence class. The name attribute is used to specify the class name, and the table attribute is used to specify the table which the class represents.
c. id:
This element is used to map the primary key of the table to an instance variable of the class.
d. property:
This element, along with its child element column, maps the other attributes (or columns) to the instance variables of the persistence class.
3. Hibernate Configuration file:
This file can be called the entry point to a Hibernate enabled application. It contains the configuration that controls the communication with the underlying database. In here all the mapping files being used by the application are declared. The hibernate-configuration element forms the root element.
a. property:
This tag is used to mention about configurations & database connections relevant information.
b. mapping:
By this element all the mapping files, also called hbm files, used by the application are declared.
It's all about making hibernate enabled application. Let's learn on practical example next.

thnx buddy...
ReplyDeleteThanx for sharing the knowledge
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete