-->
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 Loading with <Component ...> doesn't work
PostPosted: Tue Jun 13, 2006 3:16 am 
Newbie

Joined: Thu Apr 20, 2006 8:26 am
Posts: 5
This is a stripped down Example

I have an Object Foo with Metadata attached to it

Code:
class User {
    ...
}

class MetaData {
    Date creationTime;
    User creationUser;
    Date modificateionTime;
    User modificationUser;
    ...
}

class Foo {
    String attr1;
    String attr2;
    MetaData metaData;
    ...
}


my Mapping is roughly this:

Code:
<class name="Foo" table="foo">
    <property name="attr1" column="attr1" />
    <property name="attr1" column="attr1" />
   
    <component name="metaData" class="MetaData" lazy="true">
        <many-to-one name="creationUser" class="User" column="creation_user" not-found="ignore" fetch="select" lazy="no-proxy"></many-to-one>
        <property name="creationTime" type="timestamp" column="creation_time" />
        <many-to-one name="modificationUser" class="User" column="modification_user" not-found="ignore" fetch="select" lazy="no-proxy"></many-to-one>
        <property name="modificationTime" type="timestamp" column="modification_time" />
    </component>
</class>



It works in the whole, but not lazy, so I get for 200 to find Foo rows, 400 Select Statements which try to retrieve the Users (which should happen lazy, but then the whole Metadataobject should be fetched lazy)

By the way, lazy properties which are not in a component ARE fetched lazy.

Any ideas?

Thanks
Jürgen


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.