Nhibernate multiple nested collections lambda queries -
i've been rubbing head on 1 while , can't seem resolve problem.
i have classes:
- taskinstance - task - delegates (collection) - responses (collection) - delegates (collection of each response)
nhibernate mucks mappings , fails resolve properties when query taskinstances with:
expression<func<taskinstance, bool>> query; query = => i.task.responses.any(r => r.delegates.any())
but fine with:
query = => i.task.delegates.any()
the complete query lot more complicated i've identified point of failure. lambda being passed filter getpage repository method implementation uses so:
var query = _session.query<tentity>(); if (predicate != null) query = query.where(predicate);
my repository pattern works lambdas rather hibernate icriteria because want keep repository interface orm agnostic.
what i'm using: - fluentnhibernate version 1.2.0.712 - nhibernate version 3.1.0.4000
so far i've tried fluentnhibernate mapping overrides taskinstance.task.delegates , taskinstance.task.responses.delegates not lazy loaded. didn't help.
also tried replacing any() count() results in exact same query error.
the error i'm getting is
could not resolve property: delegates of: [namespace].task
leading me believe there problem because of nested collections. doing wrong? why nhibernate incorrectly assuming can find delegates collection on task instead of taskresponse?
i'll resorting using sql query if nothing else works it's not preferred choice.
Comments
Post a Comment