リスト6 mapping.xml

 1 <!DOCTYPE databases
 2           PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
 3           "http://castor.exolab.org/mapping.dtd">
 4 <mapping>
 5   <class name="com.netpotlet.nymph.JdoGoods"
 6          identity="id">
 7     <description>Each Goods</description>
 8     <map-to table="goods"/>
 9     <field name="id" type="integer" >
10       <sql name="id" type="integer"/>
11     </field>
12     <field name="name" type="string">
13       <sql name="name" type="char"/>
14     </field>
15     <field name="sample" type="string">
16       <sql name="sample" type="char"/>
17     </field>
18     <field name="date" type="date">
19       <sql name="date" type="date"/>
20     </field>
21     <field name="description" type="string">
22       <sql name="description" type="char"/>
23     </field>
24     <field name="category" type="com.netpotlet.nymph.Category">
25       <sql many-table="category"/>
26     </field>
27     <field name="price" type="com.netpotlet.nymph.Price">
28       <sql many-table="price"/>
29     </field>
30   </class>
31
32   <class name="com.netpotlet.nymph.Category"
33          identity="id">
34     <description>Category</description>
35     <map-to table="category"/>
36     <field name="id" type="integer">
37       <sql name="id" type="integer" />
38     </field>
39     <field name="name" type="string">
40       <sql name="name" type="char" />
41     </field>
42   </class>
43
44   <class name="com.netpotlet.nymph.Price"
45          identity="id">
46     <map-to table="price"/>
47     <field name="id" type="integer">
48       <sql name="id" type="integer"/>
49     </field>
50     <field name="cost" type="integer">
51       <sql name="cost" type="integer"/>
52     </field>
53     <field name="retail" type="integer">
54       <sql name="retail" type="integer"/>
55     </field>
56   </class>
57 </mapping>