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

Mapping a view and Schema Export Workaround: Revision #3

Wiki Page Hierarchy


Page Details

First published by:
on 09-05-2008
Last revision by:
on 03-30-2011
3 people found this article useful.

Mapping a view and Schema Export Workaround

NHibernate can easily map a View as any other Table.

This works as a charm, but it has a problem with Schema Export. Schema Export will detect the view as a table and will attempt to create the unexisting table.

A workaround for this is using <database-object> tag to Drop the unwillable table on creation, someting like:

[code language="XML"]


<create>DROP TABLE UnWantedTable</create>

<drop />



An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ...

I opened this suggestion in this JIRA, you can vote for it if you also want to map your views!


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