I just ran into a problem today which is quite well described in this
SO question: http://stackoverflow.com/q/3050050/65611

Is there anyway to filter a bag of joined-subclasses based upon a
super-class property?

Using the example from the OP my mappings look a bit like this.

<class name="Parent">
  <id .. />
  <property name="IsDeleted" type="System.Boolean">
    <column name="IsDeleted" />
  </property>
  <joined-subclass name="Child">
    <key>
      <column name="ParentId" />
    </key>
    ...
  </joined-subclass>
</class>

<class name="Other">
  ...
  <bag name="Children">
    <key column="OtherId" />
    <one-to-many class="Child" />
    <filter name="deletedFilter" condition="IsDeleted = 0" />
  </bag>
</class>

When I try to use this code I get the error: "Invalid column name
'IsDeleted'" which makes perfect sense since the filter would be
applied as sql not hql. However I need a way to filter based  on a
column from the super-class table. I've tried using the parent class
table name (condition="Parent.IsDeleted = 0") but I get "The multi-
part identifier 'Parent.IsDeleted" could not be bound." doubtless
because the table is aliased.

Any solutions to this issue?

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