NHibernate (and Fluent): is it possible to prevent the creation of a specific table through SchemaExport.Create?

I am using Fluent NHibernate (and I'm a beginner). I have mapped a read-only table that already exists in the database (this is actually a view in db). In addition, I have mapped new classes for which I want to create tables using SchemaExport.Create ().

In my current mapping, I specified "ReadOnly ()" to mark the view as immutable. However, when I execute SchemaExport.Create (), it still tries to create the table, so I get the error "There is already an object named" vw_Existing ".

Is there a way to prevent NHibernate from trying to create this particular table?

I assumed that I could export and modify sql (SetOutputFile), but it would be nice to use SchemaExport.Create ().

Thank.

+3
source share
1 answer

You are looking for

SchemaAction.None();
+5
source

Source: https://habr.com/ru/post/1796184/


All Articles