Hibernate mapping file is used by hibernate framework to get the information about the mapping of a POJO class and a database table.
It mainly contains the following mapping information:
- 1. Mapping information of a POJO class name to a database table name.
- 2. Mapping information of POJO class properties to database table columns.
Elements of the Hibernate mapping file:
- 1. hibernate-mapping: It is the root element.
- 2. Class: It defines the mapping of a POJO class to a database table.
- 3. Id: It defines the unique key attribute or primary key of the table.
- 4. generator: It is the sub element of the id element. It is used to automatically generate the id.
- 5. property: It is used to define the mapping of a POJO class property to database table column.
No comments:
Post a Comment