Hi guys,
I have the following, I think quite common, scenario.
I have a method in a DAO that builds an ICriteria based on some input filters. The criteria is then applied to different queries, projections etc etc.
Now I got a new requirement where I have to use a detached criteria in order to perform a subquery. Unfortunately, I cannot reuse the existing code to build the criteria because a detached criteria is not an ICriteria. I don't understand why these two don't share a common interface to build criterions and sub criteria.
What would be the appropriate approach to avoid code duplication here?
Regards, Alex
|