|
NHibernate Mapping Topic updated 5-10-2007 |
|
NHibernate mapping files are generated by the Table Template to give the NHibernate Framework the information it needs to map rows from database entities to POCO Class instances and vice versa. NHibernate mapping files are XML files (file extension .hbm.xml) that conform to an XML Schema defined by the NHibernate Framework. Example: the first few rows of a generated NHibernate mapping file <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="BOLayer.MyTable, BOLayer" table="MyTable"> <id name="MyTableID" column="MyTableID" type="System.Int32">
As with other source files generated by GenWise, you can enhance it by adding custom code. It is advisable to only do so if you understand the NHibernate mapping schema well. Be aware that most configuration options of the Table Template also have an impact on the generated mapping.
See also The online NHibernate documentation about mapping can be found here: http://www.hibernate.org/hib_docs/nhibernate/html/mapping.html.
|