I am not experienced with those filters but if it's some kind of raw
SQL you can write in the conditions, you could try a subselect
"ParentId NOT IN (SELECT ParentId FROM Parent WHERE IsDeleted = 1)"

On 29 Jun., 20:55, Joel P <[email protected]> wrote:
> 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