don't use a removal aware collection class in your collection-descriptor. Per default OJB use such a collection to detect all removed objects from your 1:n collection.
So try to set
collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList"
in your collection-descriptor.
regards, Armin
Emmanuel Mascarenas wrote:
I have a simple n:m relation:
user *..* rol
I brake this with a middle table
user 1..* user_rol *..1 rol
Everything is fine, the problem is when a delete a rol from the rol user's collection, the rol it self is deleted and I want to keep it.
Here es the code on user:
/** @ojb.collection * element-class-ref="model.security.Rol" * auto-retrieve="true" * auto-update="true" * foreignkey="user_id" * remote-foreignkey="rol_id" * indirection-table="user_rol" */ protected Collection roles;
Here es the auto generated code on repository_user.xml
<collection-descriptor name="roles" element-class-ref="model.security.Rol" indirection-table="user_rol" auto-retrieve="true" auto-update="true"
<fk-pointing-to-this-class column="user_id"/> <fk-pointing-to-element-class column="rol_id"/> </collection-descriptor>
Thanks all in advance Emmanuel
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
