Officially part of the NHibernate project (in the NHibernate-Contrib section), the T4 hbm2net project will generate .NET classes from hbm.xml
mapping files. Running the console application hbm2net.exe
and passing in the name of the hbm.xml
mapping files (*.hbm.xml
), the application will generate partial classes with all of the mapped fields. As this is a templated generator, you can "tweak" the template to output the generated classes in any way that you would like them.
This generator creates classes using the hbm.xml
mapping files as a model for the POCOs. It can be coupled with the hbm2ddl project to generate database scripts, or you can use the ddl2hbm tool to generate the hbm.xml
files.
In the previous screenshot, you can see the results of generating classes from the mapping files from the Ordering.Data
(in the Mapping folder) being generated into a folder named Generated
.
You can find out more about this generator at http://nhforge.org/blogs/nhibernate/archive/2009/12/12/t4...