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.  [ 3 posts ] 
Author Message
 Post subject: lazy=true problem
PostPosted: Thu Jul 20, 2006 10:53 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi all,

I´ve created a HQL to find the currencies. It´s a simple hql:

Code:
FROM CurrencyTO currency


within the CurrencyTO exists a list of items. I don´t want load
the list, BUT when I debuging, all items are being loaded.
I did not understand because I´m using lazy=true, like the mapping:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
  <class name="Proj.TO.Codification.CurrencyTO,Proj.TO"
        table="cod_moeda" lazy="true">

    <id name="Code" column="cd_moeda">
      <generator class="assigned"/>
    </id>

    <property name="Name" column="no_moeda"/>

    <property name="Value" column="valor"/>

    <bag name="Items" inverse="true" lazy="true">
      <key column="cd_moeda"/>
      <one-to-many class="Proj.TO.Codification.ItemTO, Proj.TO"/>
    </bag>

  </class>
</hibernate-mapping>


What´s happening in this case?

thanks!!!!

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 30, 2006 11:02 am 
Newbie

Joined: Fri Jul 28, 2006 4:32 am
Posts: 9
deleted - bad post sorry :/


Last edited by lc on Sun Jul 30, 2006 12:24 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 30, 2006 11:19 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Lazy only applies to cases where another object has a reference to CurrencyTO. In your case, why are you executing the query at all, if you don't want the result?


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

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.