-->
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.  [ 2 posts ] 
Author Message
 Post subject: re: hibernate mapping with batch-size and lazy
PostPosted: Mon Nov 07, 2005 10:13 pm 
Hello,

i got the following hibernate mapping;
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class name="com.wf.core.wOffer" table="WATEROFFER" lazy="true">
<id name="id" type="long">
<generator class="native"/>
</id>
...
...
<set name="tenderOffers" inverse="true" batch-size="10">
<key column="waterOffer"/>
<one-to-many class="com.wf.core.TenderOffer"/>
</set>
</class>

</hibernate-mapping>

and default lazy is false, since i using hibernate 2.0x

is this the way to implement lazy with the batch-size?
i just want to increase the proformance of the hibernate


Top
  
 
 Post subject: Re: re: hibernate mapping with batch-size and lazy
PostPosted: Tue Nov 08, 2005 2:09 am 
Quote:
...
<set name="tenderOffers" inverse="true" batch-size="10">
<key column="waterOffer"/>
<one-to-many class="com.wf.core.TenderOffer"/>
</set>


I use following class to set the object;
Code:
public TenderOffer getTheOffer() {
        Set theOffers = getTenderOffers();
        Iterator it = theOffers.iterator();
        while (it.hasNext()) {
            TenderOffer to = (TenderOffer) it.next();
           
            if (to.getOfferer().getId().equals(getBuyer().getId())
                && to.getAccepted().booleanValue()) {
                return to;
            }
        }
       
        return null;
       
    }

Insted of getting the entire object, what would be the best way to increase the preformance, how can i get the pointer to the object?


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.