Risking to ask very basic question, but still, here it is.
When using query like this
List<User> users = session.Query<User>.ToList();
In debugging I see that besides user entity I’m fetched and Role collection and Photo collection.
My question is how can I select only User collection without child collections.
Thanks
Update:
public RoleMap()
{
Table("Role");
Id(x => x.Id).GeneratedBy.Identity();
Map(x => ...
References(x => x.User).Column("UserId");
}
As far as I know lazy loading is turned on by default. Correct me If I anything doing wrong here.
double check your generated sql.
Lazy load is on by default, so I think you are entering those collections in debuging on + sign to related collection and those should be load on demand clicking on that sign.
Please use nhibernate profiler to check generated sql.