What are the drawbacks of using collections that do not implement
ManageableCollection ?
Will the cache system work as before ?

-----Message d'origine-----
De : Guillaume Nodet [mailto:[EMAIL PROTECTED]
Envoye : mardi 13 janvier 2004 18:12
A : OJB Users List
Objet : RE: Problem using strongly typed collections


Yes, I have one, but it cannot be used by  PersistentFieldIntrospectorImpl
because the getPropertyDescriptor().getWriteMethod() returns null.
I think this is because the set accessor
        public void setBs( Collection )
is not recognized as a setter for the property
        public BList getBs()
because they have not the same type.

-----Message d'origine-----
De : Larry V. Streepy, Jr. [mailto:[EMAIL PROTECTED]
Envoye : mardi 13 janvier 2004 18:06
A : OJB Users List
Objet : Re: Problem using strongly typed collections


I know that it may have just been omitted from your example data model,
but do you have a
    public void setBs( Collection )
method in A?

Guillaume Nodet wrote:

>The problem is the object model cannot be modified.
>
>-----Message d'origine-----
>De : Thomas Mahler [mailto:[EMAIL PROTECTED]
>Envoye : mardi 13 janvier 2004 17:41
>A : OJB Users List
>Objet : Re: Problem using strongly typed collections
>
>
>Hi Guilaume,
>
>Guillaume Nodet wrote:
>
>
>>I've got an object model with strongly typed collections:
>>
>>      class A {
>>              private BList bs;
>>              public  BList getBs();
>>      }
>>
>>      class B {
>>              ...
>>      }
>>
>>      class BList implements Collection {
>>              ...
>>      }
>>
>>When I store the object, everything is good, but when i read it later i've
>>got an exception
>>thrown from AbstractPersistentField.set when trying to set the B
>>
>>
>collection,
>
>
>>which is a
>>ManageableCollection.
>>
>>
>
>IMO the is caused by the fact that you Blist attribute is now filled
>with a ManeageableCollection and not with BList!
>
>You have to tell in the collection-descriptor that the "bs" attribute
>must use a special collection-class="BList".
>
>To make this work You BList must implement the interface
>o.a.ojb.broker.ManageableCollection.
>
>See tutorial 3 for more details.
>
>
>
>>OJB was configured to use
>>PersistentFieldDirectAccessImpl.
>>
>>So i tried with PersistentFieldIntrospectorImpl and adding a set method
>>      public void setBs(Collection list)
>>but I've got the following exception:
>>      Can't get WriteMethod for property:bs in object:A
>>
>>
>>Is there a way to store and read my collection without writing a custom
>>PersistentField ?
>>
>>
>>
>
>IMO this is only a secondary error!
>
>cheers,
>thomas
>
>
>
>>Guillaume Nodet
>>
>>
>>
>>---------------------------------------------------------------------
>>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]
>
>
>
>

--
Larry V. Streepy, Jr.
Senior Vice President and CTO
Health Language, Inc.



---------------------------------------------------------------------
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