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