Hi Jacob,

Thanks for your response ..

Here is the repository  file .

There are two scenarios :
1. Part can have subparts ( ref.as subparts in repository)
2. Part can have parts themselves as children (ref. as children in repository)


For example :
1. Part PART1 can have mulitple subparts viz., sp1,sp2 ...
   Part PART2 can have mulitple subparts viz., sp3,sp4 ...

2. Part PART3 can have PART1,PART2 as its children ...

I am getting the error where it is trying to retrieve scenario 2 parts ...


<class-descriptor class="part.ojb.PartImpl" table="TEST.PN">

<field-descriptor
name="id"
column="PN_ID"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
access="readonly"
conversion="part.ojb.conversion.UniqueIDIntegerFieldConversion"
/>
<field-descriptor
name="parentId"
column="SUPER_PN_ID"
jdbc-type="INTEGER"
access="anonymous"
conversion="part.ojb.conversion.UniqueIDIntegerFieldConversion"
/>
<collection-descriptor
name="subparts"
collection- class="org.apache.ojb.broker.util.collections.RemovalAwareCollection"
auto-retrieve="true"
auto-update="false"
auto-delete="false"
element-class-ref="part.ojb.SubPartImpl">
<inverse-foreignkey field-ref="PartID"/>
</collection-descriptor>
<collection-descriptor
name="children"
proxy="true"
collection-class="org.apache.ojb.broker.util.collections.RemovalAwareCollection"
element-class-ref="part.ojb.PartImpl">
<inverse-foreignkey field-ref="parentId"/>
</collection-descriptor>


                <!-- Cache on a per request basis -->
                <attribute
                        attribute-name="cacheClass"
                        
attribute-value="org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl"
                />
        </class-descriptor>




From: Jakob Braeuchi <[EMAIL PROTECTED]>
Reply-To: "OJB Users List" <[EMAIL PROTECTED]>
To: OJB Users List <[EMAIL PROTECTED]>
Subject: Re: RemovalAwareCollection- limitation
Date: Sun, 07 Nov 2004 13:02:14 +0100

hi kishore,

there's no limitation of the size in collection-proxy. you're using a rather old version of ojb and the proxy-stuff has been moved to a new package, but from what i know i think the error is coming from:

..
else if (m_size != 0)
{
result = (Collection) getBroker().getCollectionByQuery(getCollectionClass(), getQuery());
}
else
{
result = (Collection) getCollectionClass().newInstance();
}
..


your class part.ojb.PartImpl cannot be casted to a Collection. have you checked your repository ?

hth
jakob

kishore talagadadeevi schrieb:

Hi ,

I am using RemovalAwareCollection for 1:n mapping for part - subparts relation.
But if the part has more than 51 subparts, I am getting the ClassCastException :
I am using OJB V1.0 ODMG API ...


I want to know whether any limitation on collection size ...

thanks

Exception is :

Caused by: org.apache.ojb.broker.PersistenceBrokerException: java.lang.ClassCastException: part.ojb.PartImpl
at org.apache.ojb.broker.accesslayer.CollectionProxy.loadData(CollectionProxy.java:160)


at org.apache.ojb.broker.accesslayer.ListProxy.loadData(ListProxy.java:187)
at org.apache.ojb.broker.accesslayer.CollectionProxy.getData(CollectionProxy.java(Compiled Code))
at org.apache.ojb.broker.accesslayer.CollectionProxy.toArray(CollectionProxy.java:248)


at part.ojb.PartImpl.getChildren(PartImpl.java(Inlined Compiled Code))



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to