Hello all,
I'm investigating how I could reasonably compare a collection on a series of objects to an incoming collection for the sake of filtering. In an old school manner I could loop a collection and compare the collection on each object to the incoming collection. This would result in a collection of objects where each object has it's own collection which meets the requirements provided by the incoming collection.
There would also be another parameter (an enum) provided alongside the incoming collection. This enum would be something like exact, any, and all. 'Exact' would mean that the objects in my resulting collection should have their own collection that equals the collection being passed in (with no more or no less objects). 'Any' would mean that at least one of the objects in my incoming collection is contained in the collection for each object in my results. 'All' would mean that each object in my resulting collection would have it's own collection that contains all of the items in the incoming collection (and possibly more).
I'm using this to apply filtering to a simple collection of objects that are maintained by nhibernate. I thought about writing an HQL query that included the IN clause and took a collection of Ids that represent my incoming collection. This seems to be fine, however, it doesn't address each of the previously mentioned three scenarios (exact, any, and all).
I'm still in investigation mode, but if anyone has any input it would be highly appreciated.
Corey
|