Hi Alessandro,
have a look at the following mapping from our CastorTestFramework (CTF).
<class name="ctf.jdo.tc1x.PrimaryKeysPerson"
identity="firstName lastName">
<description>testing multiple primary key</description>
<map-to table="tc1x_pks_person" />
<field name="firstName" type="string" required="true">
<sql name="fname" type="varchar" />
</field>
<field name="lastName" type="string" required="true">
<sql name="lname" type="varchar" />
</field>
<field name="birthday" type="date" >
<sql name="bday" type="date" />
</field>
<field name="address" type="ctf.jdo.tc1x.PrimaryKeysAddress"
collection="arraylist" />
</class>
<class name="ctf.jdo.tc1x.PrimaryKeysAddress"
depends="ctf.jdo.tc1x.PrimaryKeysPerson"
identity="id">
<description>testing multiple primary key</description>
<map-to table="tc1x_pks_address" />
<field name="id" type="integer" >
<sql name="id" type="integer" />
</field>
<field name="street" type="string" >
<sql name="street" type="varchar"/>
</field>
<field name="city" type="string" >
<sql name="city" type="varchar" />
</field>
<field name="state" type="string" >
<sql name="state" type="varchar" />
</field>
<field name="zip" type="string" >
<sql name="zip" type="varchar" />
</field>
<field name="Person" type="ctf.jdo.tc1x.PrimaryKeysPerson" >
<sql name="fname lname"/>
</field>
</class>
Hope that helps.
Ralf
Alessandro Imperio schrieb:
Hi,
I've a question about the JDO mapping.
My situation is the following:
I've got two tables (named table A and table B).
The A table has two columns that together define the primary key.
The B table has two columns referring to the A fields with a foreign
key, and another column that defines the primary key.
Table A: field1 (PK) field2 (PK)
Table B: fk_a_field1 (FK) fx_a_field2 (FK) field3 (PK).
Is there a method to describe this situation in the mapping file?
Thanks in advance
Alessandro Imperio
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
--
Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany
Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98
Email: [EMAIL PROTECTED]
Web: www.syscon-world.de
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------