views:

39

answers:

1

I have an Incident class that uses the HasMany attribute to a Location class. All works using the static Find methods. But I need to add a where clause to the Location table. I can use the Where attribute but I don't always want that clause when fetching results.

Is there any way to maybe use DetachedCriteria or something similar while querying for Incident to filter the Location table? I could use hql but it seems that I have to create my joins manually which seems redundant if I use the HasMany attribute.

+1  A: 

The [HasMany] attribute has a Where property that filters the relationship.

Another way to do semi-global filtering is with session filters.

Mauricio Scheffer