Hi,

I have a following class:

    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; }

with the following mapping:

    <?xml version="1.0" encoding="utf-8" ?>
    <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="TestApplication" assembly="TestApplication">
      <class name="MyClass" table="MyTable">
        <id name="Id" column="id">
          <generator class="native"/>
        </id>

        <property name="Code" column="code"/>
        <property name="Description" column="description"/>
        <property name="Name" formula="(SELECT b.translation FROM
translations b WHERE b.translation_id = translation_id AND
b.language_id = :TranslationFilter.LanguageId)"/>
      </class>

      <filter-def name="TranslationFilter">
        <filter-param name="LanguageId" type="Int32"/>
      </filter-def>
    </hibernate-mapping>

I'm trying to load entity through spring with:

    Session.EnableFilter("TranslationFilter").SetParameter
("LanguageId", 1);
    return Session.Get<MyClass>(1);

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?

Is it this possible (to have filters in formula) and how?

Many thanks!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to