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

Mapping a view and Schema Export Workaround: Revision #4

Wiki Page Hierarchy

Pages

Page Details

First published by:
Gustavo
on 09-05-2008
Last revision by:
markweee
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:

<database-object> <create>DROP TABLE UnWantedTable</create> <drop /> </database-object>

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!

http://jira.nhibernate.org/browse/NH-1274

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