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

Mapping a view and Schema Export Workaround: Revision #4

Page Details

First published by:
on 09-05-2008
Last revision by:
Dario Quintana
on 12-16-2008
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!


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