title: NHibernate property formula filter
body: <p>I have a following class:</p>
  
  <pre><code>MyClass
  public virtual int Id { get; set; }
  public virtual int Code { get; set; }
  public virtual int Description { get; set; }
  public virtual int Name { get; set; }
  </code></pre>
  
  <p>with the following mapping:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TestApplication" assembly="TestApplication"&gt;
    &lt;class name="MyClass" table="MyTable"&gt;
      &lt;id name="Id" column="id"&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;
  
      &lt;property name="Code" column="code"/&gt;
      &lt;property name="Description" column="description"/&gt;
      &lt;property name="Name" formula="(SELECT b.translation FROM translations b WHERE b.translation_id = translation_id AND b.language_id = :TranslationFilter.LanguageId)"/&gt;
    &lt;/class&gt;
  
    &lt;filter-def name="TranslationFilter"&gt;
      &lt;filter-param name="LanguageId" type="Int32"/&gt;
    &lt;/filter-def&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>I'm trying to load entity through spring with:</p>
  
  <pre><code>Session.EnableFilter("TranslationFilter").SetParameter("LanguageId", 1);
  return Session.Get&lt;MyClass&gt;(1);
  </code></pre>
  
  <p>but I'am getting adoexception. I see (in a profiler) that variable :TranslationFilter.LanguageId is not replaced with ? and that parameter value is not send to the server?</p>
  
  <p>Is it this possible (to have filters in formula) and how?</p>
  
  <p>Many thanks!</p>