Steps to prepare mapping files.-Greet.hbm.xml


The mapping files are required by the hibernate framework during execution to map POJO class with Database table. Mapping file consist the information about which POJO class is actaually mapped with which database table

In this article we discus about how to write hibernate mapping file for POJO classes. First we follow these steps 
1. Create a new xml file with name (Greet.hbm.xml)

 

 2. Write the following code in mapping file.




Note: When we prepare mapping file, you just copy the mapping file from hibernate distribution file and do changes according to our applications. Once you extract the jar file, then you find some hbm files in the following locations

Ex:D:\hibernate-distribution-3.3.2.GA-dist\hibernate-distribution-3.3.2.GA\project\tutorials\eg\src\main\resources\org\hibernate\auction
SHARE

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment