<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://nhforge.org/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround.aspx</link><description>Quick starts, tutorials, code snippets, custom user types, application blocks and more...</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround.aspx</link><pubDate>Wed, 30 Mar 2011 11:43:08 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:10</guid><dc:creator>markweee</dc:creator><comments>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/comments.aspx</comments><description>Current revision posted to How to by markweee on 30/03/2011 08:43:08 a.m.&lt;br /&gt;
&lt;h2&gt;Mapping a view and Schema Export Workaround&lt;/h2&gt;
&lt;p&gt;NHibernate can easily map a View as any other Table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;A workaround for this is using &amp;lt;database-object&amp;gt; tag to Drop the unwillable table on creation, someting like:&lt;/p&gt;
&lt;div style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:88f9b13c-1b26-4e08-a789-94e8cdc0b668" class="wlWriterEditableSmartContent"&gt;
&lt;pre style="width:100%;background-color:#dddddd;"&gt;&lt;div&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;database-object&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;create&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;DROP TABLE UnWantedTable&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;create&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;drop &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;database-object&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ... &lt;a href="http://www.reviewonlineuniversity.com/universities/ashwood-university.asp"&gt;&lt;span style="background: SpringGreen;"&gt;About&lt;/span&gt;
 &lt;span style="background: SpringGreen;"&gt;Ashwood&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;University&lt;/span&gt;&lt;/a&gt; &lt;span style="background: SpringGreen;"&gt;AND&lt;/span&gt; &lt;a href="http://www.reviewonlineuniversity.com/universities/rochieville-university.asp"&gt;
&lt;span style="background: SpringGreen;"&gt;About&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Rochville&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;University&lt;/span&gt;&lt;/a&gt; &lt;span style="background: SpringGreen;"&gt;AND&lt;/span&gt; &lt;a href="http://www.reviewonlineuniversity.com/universities/adison-highschool.asp"&gt;
&lt;span style="background: SpringGreen;"&gt;About&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Adison&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;High&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;School&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I opened this suggestion in this JIRA, you can vote for it if you also map your views and do not want the wrong creation of a table on export! &lt;a href="http://www.reviewonlineuniversity.com/universities/corllins-university.asp"&gt;&lt;span style="background: SpringGreen;"&gt;About&lt;/span&gt;
 &lt;span style="background: SpringGreen;"&gt;Corllins&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;University&lt;/span&gt;&lt;/a&gt; &lt;span style="background: SpringGreen;"&gt;AND&lt;/span&gt; &lt;a href="http://www.reviewonlineuniversity.com/universities/hill-university.asp"&gt;
&lt;span style="background: SpringGreen;"&gt;About&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Hill&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;University&lt;/span&gt;&lt;/a&gt; &lt;span style="background: SpringGreen;"&gt;AND&lt;/span&gt; &lt;a href="http://www.onlineeducationfacts.com/online-education-facts/woodfield-university.htm"&gt;
&lt;span style="background: SpringGreen;"&gt;Woodfield&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;University&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://jira.nhibernate.org/browse/NH-1274"&gt;http://jira.nhibernate.org/browse/NH-1274&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New Feature&lt;/b&gt;:&amp;nbsp;&lt;a href="/blogs/nhibernate/archive/2008/12/15/customizing-schema-export-with-schema-action.aspx"&gt;Customizing Schema Export with schema-action&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/revision/6.aspx</link><pubDate>Tue, 16 Dec 2008 19:08:56 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:382</guid><dc:creator>Dario Quintana</dc:creator><comments>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/comments.aspx</comments><description>Revision 6 posted to How to by Dario Quintana on 16/12/2008 04:08:56 p.m.&lt;br /&gt;
&lt;h2&gt;Mapping a view and Schema Export Workaround&lt;/h2&gt;
&lt;p&gt;NHibernate can easily map a View as any other Table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;A workaround for this is using &amp;lt;database-object&amp;gt; tag to Drop the unwillable table on creation, someting like:&lt;/p&gt;
&lt;div style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:88f9b13c-1b26-4e08-a789-94e8cdc0b668" class="wlWriterEditableSmartContent"&gt;
&lt;pre style="width:100%;background-color:#dddddd;"&gt;&lt;div&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;database-object&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;create&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;DROP TABLE UnWantedTable&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;create&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;drop &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;database-object&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ...&lt;/p&gt;
&lt;p&gt;I opened this suggestion in this JIRA, you can vote for it if you also map your views and do not want the wrong creation of a table on export!&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://jira.nhibernate.org/browse/NH-1274"&gt;http://jira.nhibernate.org/browse/NH-1274&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="background: SpringGreen;"&gt;New&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Feature&lt;/span&gt;&lt;/strong&gt;&lt;span style="background: SpringGreen;"&gt;:&lt;/span&gt;&amp;nbsp;&lt;a href="/blogs/nhibernate/archive/2008/12/15/customizing-schema-export-with-schema-action.aspx"&gt;&lt;span style="background: SpringGreen;"&gt;Customizing&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Schema&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Export&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;with&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;schema-action&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/revision/5.aspx</link><pubDate>Fri, 05 Sep 2008 20:08:09 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:204</guid><dc:creator>Gustavo</dc:creator><comments>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/comments.aspx</comments><description>Revision 5 posted to How to by Gustavo on 05/09/2008 05:08:09 p.m.&lt;br /&gt;
&lt;h2&gt;Mapping a view and Schema Export Workaround&lt;/h2&gt;
&lt;p&gt;NHibernate can easily map a View as any other Table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;A workaround for this is using &amp;lt;database-object&amp;gt; tag to Drop the unwillable table on creation, someting like:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:88f9b13c-1b26-4e08-a789-94e8cdc0b668" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;
&lt;pre style="width:100%;background-color:#dddddd;"&gt;&lt;div&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;database-object&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;create&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;DROP TABLE UnWantedTable&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;create&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;drop &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;database-object&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ...&lt;/p&gt;
&lt;p&gt;I opened this suggestion in this JIRA, you can vote for it if you also &lt;span style="text-decoration: line-through; color: red;"&gt;want&lt;/span&gt; &lt;span style="text-decoration: line-through; color: red;"&gt;to&lt;/span&gt; map your views &lt;span style="background: SpringGreen;"&gt;and&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;do&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;not&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;want&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;the&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;wrong&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;creation&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;of&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;a&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;table&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;on&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;export&lt;/span&gt;!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://jira.nhibernate.org/browse/NH-1274" target="_blank"&gt;http://jira.nhibernate.org/browse/NH-1274&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/revision/4.aspx</link><pubDate>Fri, 05 Sep 2008 20:00:42 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:25</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/comments.aspx</comments><description>Revision 4 posted to How to by Fabio Maulo on 05/09/2008 05:00:42 p.m.&lt;br /&gt;
&lt;h2&gt;Mapping a view and Schema Export Workaround&lt;/h2&gt;
&lt;p&gt;NHibernate can easily map a View as any other Table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;A workaround for this is using &amp;lt;database-object&amp;gt; tag to Drop the unwillable table on creation, someting like:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="font-weight:normal;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;[&lt;/span&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;code&lt;/span&gt; &lt;span style="text-decoration: line-through; color: red;"&gt;language=&lt;/span&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;quot;XML&amp;quot;]&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;database-object&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;create&amp;gt;DROP&lt;/span&gt; &lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:88f9b13c-1b26-4e08-a789-94e8cdc0b668" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;
&lt;pre style="width:100%;background-color:#dddddd;"&gt;&lt;div&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;&lt;span style="background: SpringGreen;"&gt;database-object&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;&lt;span style="background: SpringGreen;"&gt;create&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="background: SpringGreen;"&gt;DROP&lt;/span&gt; TABLE UnWantedTable&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/create&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;drop&lt;/span&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;&lt;span style="background: SpringGreen;"&gt;create&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;&lt;span style="background: SpringGreen;"&gt;drop&lt;/span&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/database-object&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;[&lt;/span&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;/code]&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;&lt;span style="background: SpringGreen;"&gt;database-object&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;span style="background: SpringGreen;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ...&lt;/p&gt;
&lt;p&gt;I opened this suggestion in this JIRA, you can vote for it if you also want to map your views!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://jira.nhibernate.org/browse/NH-1274" target="_blank"&gt;http://jira.nhibernate.org/browse/NH-1274&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/revision/3.aspx</link><pubDate>Fri, 05 Sep 2008 19:54:03 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:24</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/comments.aspx</comments><description>Revision 3 posted to How to by Fabio Maulo on 05/09/2008 04:54:03 p.m.&lt;br /&gt;
&lt;h2&gt;Mapping a view and Schema Export Workaround&lt;/h2&gt;
&lt;p&gt;NHibernate can easily map a View as any other Table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;A workaround for this is using &amp;lt;database-object&amp;gt; tag to Drop the unwillable table on creation, someting like:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="font-weight:normal;"&gt;&lt;span style="background: SpringGreen;"&gt;[&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;code&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;language=&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;&amp;quot;XML&amp;quot;]&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;database-object&amp;gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;lt;create&amp;gt;DROP TABLE UnWantedTable&amp;lt;/create&amp;gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;lt;drop /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/database-object&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background: SpringGreen;"&gt;[&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;/code]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ...&lt;/p&gt;
&lt;p&gt;I opened this suggestion in this JIRA, you can vote for it if you also want to map your views!&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://jira.nhibernate.org/browse/NH-1274"&gt;http://jira.nhibernate.org/browse/NH-1274&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/revision/2.aspx</link><pubDate>Fri, 05 Sep 2008 19:44:48 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:23</guid><dc:creator>Gustavo</dc:creator><comments>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/comments.aspx</comments><description>Revision 2 posted to How to by Gustavo on 05/09/2008 04:44:48 p.m.&lt;br /&gt;
&lt;h2&gt;Mapping a view and Schema Export Workaround&lt;/h2&gt;
&lt;p&gt;NHibernate can easily map a View as any other Table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;A workaround for this is using &amp;lt;database-object&amp;gt; tag to Drop the unwillable table on creation, someting like:&lt;/p&gt;
&lt;p&gt;&amp;lt;database-object&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;create&amp;gt;DROP TABLE UnWantedTable&amp;lt;/create&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;drop /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/database-object&amp;gt;&lt;/p&gt;
&lt;p&gt;An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ...&lt;/p&gt;
&lt;p&gt;I opened this suggestion in this JIRA, you can vote for it if you also want to map your views!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://jira.nhibernate.org/browse/NH-1274" target="_blank"&gt;http://jira.nhibernate.org/browse/NH-1274&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Mapping a view and Schema Export Workaround</title><link>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/revision/1.aspx</link><pubDate>Fri, 05 Sep 2008 19:37:53 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:22</guid><dc:creator>Gustavo</dc:creator><comments>http://nhforge.org/wikis/howtonh/mapping-a-view-and-schema-export-workaround/comments.aspx</comments><description>Revision 1 posted to How to by Gustavo on 05/09/2008 04:37:53 p.m.&lt;br /&gt;
&lt;p&gt;NHibernate can easily map a View as any other Table.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;A workaround for this is using &amp;lt;database-object&amp;gt; tag to Drop the unwillable table on creation, someting like:&lt;/p&gt;
&lt;p&gt;&amp;lt;database-object&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;create&amp;gt;DROP TABLE UnWantedTable&amp;lt;/create&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;drop /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/database-object&amp;gt;&lt;/p&gt;
&lt;p&gt;An idea to avoid this workaround is having some hint to SchemaExport to indicate that this class should not enter in the Export ...&lt;/p&gt;
&lt;p&gt;I opened this suggestion in this JIRA, you can vote for it if you also want to map your views!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://jira.nhibernate.org/browse/NH-1274"&gt;http://jira.nhibernate.org/browse/NH-1274&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>
