Search code examples
nhibernatenhibernate-mapping

NHibernate - use WHERE clause on one-to-one mapping


Is it possible to somehow restrict a one-to-one mapping with a constraint other than property ref? Ideally, something along the lines of the class definition, for example, where you can add where="Condition=Value".

Thanks


Solution

  • You can use nhibernate filters for this: http://nhibernate.info/blogs/nhibernate/archive/2009/05/04/nhibernate-filters.aspx