The object-relational mapper for .NET

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 Mon, 15 December 2008 02:50:00 PM by Woil
Filed under: views, export, schema action

comments powered by Disqus
© NHibernate Community 2024