Hey,
I'm currently migrating from Castle ActiveRecord to pure NHibernate and ran into a small bump.
I used to have ActiveRecord verify the consistency between my mapping and the actual database on application start-up (and provide options for recreating the database etc) using a property named "VerifyModelsAgainstDBSchema".
Now I was wondering if there was anything like this in NHibernate? I looked up the code in Castle and what they're doing is basically to preform a select from all tables with a where clause that's 1=0 and then re-wrapping any exceptions to a general type.
Now I can't be the only one who wants to implement something like this - is there a neat trick I missed in the documentation or a good way to do something like this?
I was thinking something in the lines of using GetAllClassMetadata() from the SessionFactory to get all the types mapped and then do a trick like the Castle guys.
Any ideas - comments?
Thanks,
- Rasmus.
|