hi, i finally found some sort of "solution" for this problem:
what i did in my code so far was calling PersistenceBroker.deleteByQuery(Query). this cause the mentioned problems. now i tried to use PersistenceBroker.delete(Object) and using this, the relations have been removed from the indirection table, too. this fixes my problem so far, but is that an expected behaviour for non-decomposed m:n-realtions? kr, G�nther Wieser creative-it Guglgasse 6/1/11/1 A-1110 Wien Austria http://www.creative-it.com -----Urspr�ngliche Nachricht----- Von: Guenther Wieser [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 16. Februar 2005 21:25 An: [email protected] Betreff: **SPAM** problem with m:n relation to some class hi, i'm using ojb 1.0.1, and i need to implement a m:n relation ship from objects of one class to objects of the same class. before you complain that this is strange and can lead to circular referencens, let me explain: i know that, but i need to implement this. reason is: we want to use enhydra shark, a workflow engine, and it relies on the capability of the data model that it can nest groups into groups, this way building a hierarchy of groups. here's the excerpt from repository.xml: <class-descriptor class="com.creative_it.webcreator.model.usergroup.Group" table="grouptable"> <field-descriptor id="1" name="id" column="id" jdbc-type="BIGINT" primarykey="true" autoincrement="true" /> <field-descriptor id="2" name="groupid" column="groupid" jdbc-type="VARCHAR" /> <field-descriptor id="3" name="description" column="description" jdbc-type="VARCHAR" /> <collection-descriptor name="users" collection-class="org.apache.ojb.broker.util.collections.ManageableArrayL ist" element-class-ref="com.creative_it.webcreator.model.usergroup.User" auto-retrieve="true" auto-update="link" auto-delete="link" indirection-table="usergrouptable"> <fk-pointing-to-this-class column="groupid" /> <fk-pointing-to-element-class column="userid" /> </collection-descriptor> <collection-descriptor name="subGroups" collection-class="org.apache.ojb.broker.util.collections.ManageableArrayL ist" element-class-ref="com.creative_it.webcreator.model.usergroup.Group" auto-retrieve="true" auto-update="false" auto-delete="false" indirection-table="groupgrouptable"> <fk-pointing-to-this-class column="groupid" /> <fk-pointing-to-element-class column="sub_gid" /> </collection-descriptor> <collection-descriptor name="parentGroups" collection-class="org.apache.ojb.broker.util.collections.ManageableArrayL ist" element-class-ref="com.creative_it.webcreator.model.usergroup.Group" auto-retrieve="true" auto-update="false" auto-delete="false" indirection-table="groupgrouptable"> <fk-pointing-to-this-class column="sub_gid" /> <fk-pointing-to-element-class column="groupid" /> </collection-descriptor> </class-descriptor> my problem in detail is, that everything works fine when it comes to creation and update, but when i delete a group, the entries in the indirection table are not deleted. i tried all possibilities of auto-delete and auto-update, so don't bother the "false" in this excerpt. by the way, the user-group-relation (which is also a non-decomposed m:n relation) works perfect, so i'm quite sure this is just a problem of referencing the same class.... any idea how to solve this problem? kr, guenther --------------------------------------------------------------------- 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]
