You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Marc Tinnemeyer <ma...@tinnemeyer.com> on 2005/08/10 16:01:58 UTC
n:m trouble
dear listmembers,
i got the following setup:
[person] 1:n (todo) n:1 [ticket]
so "todo" is my indirection-table. the trouble is, after adding a
ticket to a person (add it to the person's todolist (the ticket-object
gets updated) and then loading the ticket, the person that was just added to the ticket is not in the
tickets's users collection.
on the one hand there is the person's todo-list and on the other hand
everbody who has the ticket on his/her todo-list should be included in
the ticket when viewed.
a person is furthermore able to remove him-/herself from a ticket's todo
while viewing the ticket (and via personal todo-list).
i need a solution that enables me to perform updates von both sides. is
there a way to achieve this ?
here's my mapping:
####################################
## user object
<class-descriptor class="xxx.UserBO" table="user">
<field-descriptor name="id" column="id" jdbc-type="INTEGER" primarykey="true" autoincrement="true" />
<collection-descriptor
name="tickets"
collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList"
element-class-ref="xxx.TicketBO"
auto-retrieve="true"
auto-update="link"
indirection-table="todo">
<fk-pointing-to-this-class column="user_id"/>
<fk-pointing-to-element-class column="ticket_id"/>
</collection-descriptor>
</class-descriptor>
## ticket object
<class-descriptor class="xxx.TicketBO" table="tickets">
<field-descriptor name="id" column="id" jdbc-type="INTEGER" primarykey="true" autoincrement="true" />
.
.
.
<collection-descriptor
name="users"
collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList"
element-class-ref="xxx.UserBO"
auto-retrieve="true"
auto-update="link"
indirection-table="todo">
<fk-pointing-to-this-class column="ticket_id"/>
<fk-pointing-to-element-class column="user_id"/>
</collection-descriptor>
</class-descriptor>
######################################
do i get something wrong ?
ojb version is 1.0.1
kind regards
marc tinnemeyer
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org