SubQuery nHibernate without collection -
SubQuery nHibernate without collection -
for example:
tree treealias = null; var nonrottenapples = queryover.of<apple>() .where(a => !a.isrotten) .where(a => a.tree.id == treealias.id) .select(x => x.id); // <- optional
return nhibernatesession.queryover(() => treealias) .where(t => t.id.isin(listoftreeid)) .withsubquery.whereexists(nonrottenapples) .list();
how subquery not collection in apple ? i'm researching @ various locations, not find results question. results collections.
my interpretation of question you're trying query trees don't have rotten apples.
i believe work:
var rottentreeids = queryover.of<apple>() .where(apple => apple.isrotten) .select(a => a.tree.id); homecoming nhibernatesession.queryover<tree>() .where(t => t.id.isin(listoftreeid)) .withsubquery.whereproperty(t => t.id).notin(rottentreeids) .list();
nhibernate collections subquery nhibernate-queryover
Comments
Post a Comment