Fluent NHibernate View Mapping requires Id Column

When trying to use FNH to display a view - FNH insists that the Id property be displayed. However, not all of my views have a unique identity column.

I can get around this with XML mappings as I can just specify

<id type="int">  
   <generator class="increment"/>  
</id>

      

at the top of the display.

Is there a way to duplicate this in FNH ...?

+2


a source to share


3 answers


At the time I asked the question, this was not supported in Fluent NHibernate

. One of the developers added it as a feature and we are evaluating it for now.



0


a source


Pretty sure the view should be indexable, which I haven't done in a while, but I recall that it involves creating composite keys and providing a SchemaBound view. Then, in the FNH mapping, you must provide the table name (which you probably already have) and the UseCompositeId method.



0


a source


mapping.Id(x => x.ID).GeneratedBy.Increment()

      

But perhaps my understanding of the question is wrong.

0


a source







All Articles