-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Lazy Not working
PostPosted: Wed Dec 12, 2007 5:41 pm 
Newbie

Joined: Wed Nov 14, 2007 9:44 am
Posts: 4
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

_________________
get{ return heliegesio;}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.