Hello Gong,

please start a new thread when you ask a new question.

> -----Original Message-----

> class myList and myEntry has a 1:n relationship
> each myList has a collection of myEntry(s)

[..]

>   <collection-descriptor
>       name="entries"
> 
> collection-class=
> "org.apache.ojb.broker.util.collections.ManageableArrayList"
>       element-class-ref="myEntry"
>       auto-retrieve="true"
>       auto-update="true"
>       auto-delete="true"
>       >
>       <inverse-foreignkey field-ref="listId"/>
>   </collection-descriptor>
> 
> </class-descriptor>

[..]

> in this way, listPersisiter.store() and get() can automatically
> store and retrieve entry.
> 
> but when i retrieve myList, and remove an entry from
> myList.entries, and store back, it can not automatically
> delete the entry in DB which have been removed from
> myList.entries.

If you want this behaviour, you must not use
the ManageableArrayList (as you explicitly do, see above)
but have to use the RemovalAwareCollection (which is
actually the default.)

Just remove the attribute collection-class from the 
class-descriptor and try again.

BTW: this is a FAQ.

Olli

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

Reply via email to