Hi all,
I have a Proxy loading problem:
I have two classes "classA" and "classB"
which do have a 1:n relation
my repository
<class-descriptor class="com.jmedia.map.entryForm.InterfaceC">
<extent-class class-ref="com.jmedia.map.entryForm.ClassA" />
<extent-class class-ref="com.jmedia.map.entryForm.ClassB" />
</class-descriptor>
<class-descriptor
class="classA"
table="A_Table"
>
...
...
<collection-descriptor
name="ClassBCollection"
element-class-ref="classB"
auto-retreive="true"
auto-update="true"
auto-delete="true"
orderby="id"
sort="DESC"
>
<inverse-foreignkey field-ref="classAId"/>
</collection-descriptor>
</classDescriptior>
<class-descriptor
class="classB"
proxy="dynamic"
table="B_Table"
>
<field-descriptor
name="classAId"
column="classAId"
jdbc-type="INTEGER"
/>
...
...
</classDescriptior>
my java code :-)
interface interfaceC
{
get **
set **
}
class classA extends interfaceC
{
get **
set **
Collection getClassBCollection();
}
class classB extends interfaceC
{
get **
set **
}
because "class B" is about 30.000 times in "classA" collection
for me it's important to use "lazy loading" because
I only need about 100-500 items from "class B" at one time.
and it works fine
Collection myColl = classA.getClassBCollection();
But if I try to get one Element, and try to cast it to "classB"
classB myclassB = (classB)myColl.next();
it throws a class cast exception
only if I cast to the Interface (InterfaceC) everthing works fine
so the "proxy loader" loads only the interface
with its values and not the whole classB
is it possible to load dynamically all required classB elements
and not only the interfaces ?
thank you in advance.
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]