NHibernate Forge
The official new home for the NHibernate for .NET community

Customizing Schema Export with schema-action

Mapping views with NHibernate just got a whole lot easier. Previous to revisions committed to the trunk today (Dec 15, 2008) there was no good way to exclude certain files from being exported with a schema export.

Now a new attribute has been added to the <class> schema.

<class name="Cat" schema-action="none|drop|export|update|validate|all"> ...

Using this to map a view is easy:

<class name="CustomersView" table="CustomsReportView" schema-action="none" mutable="false"> ...

This will automatically exclude this class from all schema actions such as updates, drops, and exports. You can mix and match with schema-action="update,drop" etc.

 

 


Posted dic 15 2008, 04:50 p.m. by Woil
Filed under: , ,

Comments

Chorn Sokun wrote re: Customizing Schema Export with schema-action
on 03-29-2009 5:37

I've gone through the NH code but it doesn't seem to have a good explanation for these options and how it affect schema export.

Could you elaborate a bit more?

Powered by Community Server (Commercial Edition), by Telligent Systems