I set lazy="false" to a collection and fetch="select", but I dont understand why NHibernate keeps loading my collection.
This is my mapping:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Ortopedia.Entidades" assembly="Ortopedia">
<class name="Especialidade" table="TB_ESPECIALIDADE">
<id name="Id">
<column name="ID_ESPECIALIDADE" not-null="true" />
<generator class="increment" />
</id>
<property name="Nome" column="NOME" not-null="true" length="50" />
<set inverse="true" name="SubEspecialidades" cascade="none" fetch="select" lazy="false" >
<key column="ID_ESPECIALIDADE" />
<one-to-many class="Ortopedia.Entidades.SubEspecialidade" />
</set>
</class>
</hibernate-mapping>
And this is the code I'm using to list the data:
ICriteria criteria = session.CreateCriteria(typeof(T));
criteria.SetMaxResults(1000);
IList<T> list = criteria.List<T>();
return list;
NHibernate loads my SubEspecialidades property, I dont want it to load. What am I missing here?