Because I set a lazy = "true" in a bag and still the nhibernate this pressing all tables daughters of the class that I set in the block bag?
Porque que eu defino um lazy="true" em uma bag e mesmo assim o nhibernate esta carregando todas as tabelas filhas da classe que eu defino no bloco bag?
Ex.:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="RGTIOR" namespace="RGTIOR">
<class name="Funcionario" table="Funcionario">
<id name="IdPessoa" column="idPessoa" type="Decimal" unsaved-value="0">
<generator class="foreign">
<param name="property">fkPessoa</param>
</generator>
</id>
<one-to-one name="fkPessoa" class="Pessoa" constrained="true" cascade="all"/>
<many-to-one name="IdEquipe" column="idEquipe" class="Equipe" cascade="none" />
<many-to-one name="IdCargo" column="idCargo" cascade="save-update" class="Cargo" />
<property column="descricao" type="String" name="Descricao" not-null="true" length="50" />
<property column="dsObservacao" type="String" name="DsObservacao" length="2147483647" />
<bag name="SalarioList" cascade="all" inverse="true" lazy="true">
<key column="idPessoa" />
<one-to-many class="Salario" />
</bag>
</class>
</hibernate-mapping>
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="RGTIOR" namespace="RGTIOR">
<class name="Salario" table="Salario">
<id name="IdSalario" column="idSalario" type="Decimal" unsaved-value="0">
<generator class="native"/>
</id>
<many-to-one name="IdPessoa" column="idPessoa" class="Funcionario" />
<property column="vlSalario" type="Decimal" name="VlSalario" not-null="true" />
<property column="dtSalario" type="DateTime" name="DtSalario" not-null="true" />
</class>
</hibernate-mapping>
He brought all of this class Funcionario ... and I so want the idsalario of class salario
<many-to-one name="IdPessoa" column="idPessoa" class="Funcionario" />
Ele esta trazendo tudo da classe Funcionario...e eu so quero o idsalario da classe salario