Why doesn't LINK support simple outer joins (given the where clause on the outer join table)?

I have tableA and tableB

tableA tends B_Id .

This request works fine:

 IEnumerable<A> a = Session.Query<A>().Fetch(r=>r.B);

but i want something like:

 IEnumerable<A> a = Session.Query<A>().Where(r=>r.B.Active).Fetch(r=>r.B);

it seems that when I do this, it no longer performs a simple outer join, and if there are no active records in table B, I get no results.

I want to make a clean outer join that will still give me results, but with property B of object A as null.

Does nhibernate LINQ support this ability to put the where clause in your external table?

+3
source share
2 answers

nhusers, , -, , HQL.

, , , , . .

+3

: .Where(a => a.B == null || a.B.Active)

: A, . NHibernate A, B == null B.Active == false?

, , B A, . , A? B ? , B.Active == false. ? , NHibernate , .

0

Source: https://habr.com/ru/post/1783290/


All Articles