How can I disable child collection loading?
I want to do nex thing:
Code:
<set name="Names" table="NAMES" DoNotUseLazyAndDoNotLoadThisCollection="true">
<key column="group_id" />
<element column="NAME" type="String" />
</set>
because lazy loading is not supported in medium trust level
And then write the following method
Code:
public IList Names
{
get {
if (names == null) {
names = LoadPropertyManually("Names");
}
return names;
}
}
The main advantage of "DoNotUseLazyAndDoNotLoadThisCollection" is that I will be able to use Names collection in HQL queries