According to the error message, OJB is trying to set a field whose type is
DatedList ("target field type") with a value which is a
RemovalAwareCollection ("object value class"). This is probably because
you aren't setting collection-class in the collection-descriptor. In
1.0.2, AFAIK RemovalAwareCollection is still the default class used when
collection-class isn't set, so OJB creates a RemovalAwareCollection to
hold the retrieved elements and then tries to put it into your DatedList
attribute, which fails. Setting collection-class="...DatedList" should
solve the problem.
-steve
Steve Clark
ECOS Development Group
[EMAIL PROTECTED]
(970)226-9291
"Lemke, Wesley" <[EMAIL PROTECTED]>
05/18/2005 08:58 AM
Please respond to
"OJB Users List" <[email protected]>
To
"OJB Users List" <[email protected]>, "Thomas Dudziak"
<[EMAIL PROTECTED]>
cc
Subject
RE: Using user defined Collections
I am still getting this error:
[5/18/05 9:57:20:166 CDT] 74345b16 SystemOut O [PersistentField]
ERROR: while set field:
[try to set 'object value' in 'target object'
target obj class: com.lmig.pm.affinity.model.client.account.AccountTeam
target field name: accountManagers
target field type: class com.lmig.pm.affinity.util.DatedList
target field declared in:
com.lmig.pm.affinity.model.client.account.AccountTeam
object value class:
org.apache.ojb.broker.util.collections.RemovalAwareCollection
object value: [null(N0100000)]
]
I have tried to extend bot ManageableArrayList and RemovalAwareList.
Both give the same error. I am using OJB 1.0.2. Any other ideas?
-----Original Message-----
From: Thomas Dudziak [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 1:29 AM
To: OJB Users List
Subject: Re: Using user defined Collections
> Because we are subclassing from ArrayList, I didn't think that
> we would need to use the collection-class attribute of the
> collection-descriptor or implement ManageableCollection. Is this
> true?
Nope, if you want OJB to create DatedList objects and initialize the
properties with it, you'll have to implement ManageableCollection. The
easiest way is probably to extend ManageableArrayList (OJB 1.0.3) or
TrackingListImpl (OJB 1.1) instead of ArrayList directly. Also in this
case, you should not need to specify collection-class if you declare the
collection fields with this type.
Tom
---------------------------------------------------------------------
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]