I would like to make a many to many relation with a role classifier on the relation. Is it possible with Castor JDO? In that case - how? I have checked the JDO examples and the test cases, and there are only normal many-many relations without role classifier.
/ Orjan
Below is an example of the mapping file and the corresponding tables:
<mapping>
<key-generator name="MAX" alias="normal">
</key-generator>
<class name="Station"
identity="id" key-generator="normal">
<description>A station participating in a session</description>
<map-to table="Station" />
<field name="id" type="integer" >
<sql name="stationId" type="integer"/>
</field>
<field name="name" type="string">
<sql name="name" type="varchar" />
</field>
</class>
<class name="Session"
identity="id" key-generator="normal">
<description>A send/receive session</description>
<map-to table="Session" />
<field name="id" type="integer" >
<sql name="sessionId" type="integer"/>
</field>
<field name="name" type="string">
<sql name="name" type="varchar" />
</field>
<field name="participants" type="Station"
collection="vector">
<sql name="stationId"
many-table="Participant" many-key="sessionId"/>
</field>
</class>
</mapping>
Create table Session (
sessionId Int NOT NULL ,
name Varchar(20) ,
UNIQUE (sessionId),
Primary Key (sessionId));
Create table Station (
stationId Int NOT NULL ,
name Varchar(20),
UNIQUE (stationId),
Primary Key (stationId));
Create table Participant (
role Char(5) NOT NULL , // SEND, RECEIVE, etc.
stationId Int NOT NULL ,
sessionId Int NOT NULL ,
Primary Key (stationId,sessionId));
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
