This post was originally posted here
NHibernate provides a number of tools
for developers to manage their database. I prefer mapping driven
approach in which I let NHibernate generate the schema for database for
me. By that way, I only concentrate on my domain. For me, database is
not the center but only a tool for storage most of the cases.
approach is valid only for greenfield projects. If you’re using a
legacy database, however, things get more complicated and you write
your mappings according to your database.
now(with revision 3918, which means you have to use trunk until we
release it) provides a way to verify your mappings against your
The usage is similar to other tools
I won’t write a dedicated code for this but rather I am going to copy the tests from the code itself.
SchemaValidator has a single method called Validate. You give it the configuration and it validates the schema.
nov 22 2008, 11:55 p.m.