Take or First does a Limit on all lines when join and not only on primary entitiy

Description

Hi,

I have a Class (PlaceMap) that have an IList property (Areas). I map this property with HasMany and set the fetching strategy to Join.
When i retrieved one PlaceMap using Linq to Nhibernate, the generated query (Postgres 8.3 looks like this) :

select this_.id, this_.place_id, place_area.id
from map.place_map this_
left outer join map.place_area place_area_ on this_.id=place_area_.place_map_id
where this_.id=0 limit 1

p0 = 5
p1 = 1

this linq query looks like Session.Linq<PlaceMap>().Where(c => c.Id = 5).FirstOrDefault();
I would expect this query to retrieve one PlaceMap with ALL the childrens, but it only retrieves one PlaceMap with one PlaceArea.
The sql query should look like that :
select this.id, this.place_id,
place_area_.id
from (
select this_.id, this_._place_id
from map.place_map this_
where this_.id=0 limit 1)
left outer join map.place_area place_area_ on this_.id=place_area_.place_map_id

Thanks

Environment

None

Assignee

Unassigned

Reporter

Yann ROBIN

Labels

None

Components

Affects versions

Priority

Blocker
Configure