views:

561

answers:

0

We have a legacy db that I am mapping to NHibernate. We have some calls that accept a Predicate object that generates a where clause for a table/view entity. We were able to modify the Predicate to return Criterion and use it with the table entity. This method does not work with the view entities, because the mappings return an error because there is no id/composite-id defined in the mapping. I would prefer not having to create a fake rowid on each view.

Could I use a Named SQL Query that did a SELECT and then the Criterion to append the where clause. Or is there a better way to handle this? I still want the view to be returned as the entity.