You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Reda Benzair <re...@smartjog.com> on 2004/02/06 19:17:21 UTC
dernier réponse :::: upgrade to RC5, ClassCastException on getCollectionByQuery
Armin Waibel wrote:
> Hi Raymond,
>
> Jakob has checked in a fix. Will be included
> in the upcoming 1.0 version.
>
> regards,
> Armin
>
> Armin Waibel wrote:
>
>> Hi,
>>
>> rbarlow@raymanoz.com wrote:
>>
>>> Hi Armin,
>>>
>>> Ah, right yes, that would make sense. Those 2 classes are not
>>> instances of
>>> Collection. They descend from java.lang.Object (ie. does not extend
>>> anything). The implement ManagableCollection.
>>>
>>> This worked for rc3, I guess there's been changes around that since.
>>> Does
>>
>>
>>
>> yes, I think the prefetching mechanism was added since rc3
>>
>>> this mean that I now need to descend all my custom list classes from
>>> Collection?
>>
>>
>>
>> hmm, I don't implement this new part, but I assume it's a bug,
>> because I can't find an note in the release-notes that now all
>> collection-class need to be instance of collection. And this wouldn't
>> be make sense because in repository.dtd we say
>> "This attribute must only specified if the attribute type is not a
>> java.util.Collection (or subclass) or Array type."
>>
>> I will try to add a test case for this problem.
>>
>> regards,
>> Armin
>>
>>>
>>> -Raymond
>>>
>>>
>>>> Hi Raymond,
>>>>
>>>> the error occured in method prefetchRelationship(Collection owners)
>>>> line 149 when a cast for the 1:n references is done.
>>>> The cast is
>>>>
>>>> if (collectionClass != null)
>>>> {
>>>> newChildren = (Collection)
>>>> broker.getCollectionByQuery(collectionClass, queries[i]); //Line 149
>>>> }
>>>>
>>>> Thus I think OJB has problems with one of your collection class in
>>>> class-descriptor of Employee
>>>>
>>>> <collection-descriptor
>>>> name="contracts"
>>>> element-class-ref="com.hours28.domain.entity.EmployeeContract"
>>>> collection-class="com.hours28.domain.entity.EmployeeContractCollection"
>>>>
>>>> auto-retreive="true"
>>>> auto-update="true">
>>>> <inverse-foreignkey field-ref="employeeId"/>
>>>> </collection-descriptor>
>>>>
>>>> <collection-descriptor
>>>> name="employeeServiceDetails"
>>>> element-class-ref="com.hours28.domain.entity.EmployeeServiceDetail"
>>>> collection-class="com.hours28.domain.entity.EmployeeServiceDetailCollection"
>>>>
>>>> auto-retreive="true"
>>>> auto-update="true">
>>>> <inverse-foreignkey field-ref="employeeId"/>
>>>> </collection-descriptor>
>>>>
>>>> Are both classes EmployeeContractCollection,
>>>> EmployeeServiceDetailCollection instance of Collection?
>>>>
>>>> regards,
>>>> Armin
>>>>
>>>> Raymond Barlow wrote:
>>>>
>>>>
>>>>> Hi Armin,<snip>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
--
*Reda BENZAIR**
*Software Analyst
***
*Phone: +33 (0)1 4996 6324
Fax: +33 (0)1 4996 6405
Mobile: +33 (0)6 6240 6192
reda.benzair@smartjog.com <ma...@smartjog.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org