InterviewSolution
| 1. |
Explain About Nhibernate Mapping Files? |
|
Answer» Mapping files form core of any database. These files contain field to field mapping, usually this mapping occurs between classes and ATTRIBUTES. Sample mapping file: <?xml version="1.0" encoding="utf-8" ?> No NEED to specify column name if database column name is same as property . <property name="Name" column="database-column-name" /> Also, right-click on "FirstSample.hbm.xml", select "Properties" and change the "Build ACTION" to "Embedded Resource". The mapping file will now be a part of the Asssembly. Mapping files form core of any database. These files contain field to field mapping, usually this mapping occurs between classes and attributes. Sample mapping file: <?xml version="1.0" encoding="utf-8" ?> No need to specify column name if database column name is same as property . <property name="Name" column="database-column-name" /> Also, right-click on "FirstSample.hbm.xml", select "Properties" and change the "Build Action" to "Embedded Resource". The mapping file will now be a part of the Asssembly. |
|