Date: 2005-02-09T16:18:56 Editor: MichelleCaisse Wiki: Apache JDO Wiki Page: DefaultMappingMetadata URL: http://wiki.apache.org/jdo/DefaultMappingMetadata
no comment Change Log: ------------------------------------------------------------------------------ @@ -1,14 +1,11 @@ This is the default mapping of the Company model. {{{ -CREATE TABLE addresses { <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 1.0//EN" "http://java.sun.com/dtd/jdo_1_0.dtd"> <orm> <package name="org.apache.jdo.tck.pc.company"> - <class name="Address" table="address"/> - <class name="Company" table="companies"> <field name="companyid" column="id"/> <field name="name" column="name"/> @@ -34,16 +31,31 @@ <field name="deptid" column="id"/> <field name="name" column="name"/> <field name="company" column="companyid"/> - <field name="employees" mapped-by="department"> - <foreign-key/> - </field> + <field name="employees" mapped-by="department"/> <field name="fundedEmps" mapped-by="fundingDept"/> </class> <class name="Employee" table="employees"> <inheritance strategy="new-table"> - <discriminator strategy="classname" column="discriminator"/> + <discriminator strategy="class-name" column="discriminator"/> </inheritance> + <field name="firstname"/> + <field name="lastname"/> + <field name="middlename"/> + <field name="address"> + <embedded> + <field name="street" column="street"/> + <field name="city" column="city"/> + <field name="state" column="state"/> + <field name="zipcode" column="zipcode"/> + <field name="country" column="country"/> + </embedded> + </field> + <field name="phoneNumbers" table="employee_phoneno_type" > + <join column="personid"/> + <key column="type"/> + <value column="phoneno"/> + </field> <field name="hiredate" column="hiredate"/> <field name="weeklyhours" column="weeklyhours"/> <field name="dentalInsurance" column="dentalinsurance"> @@ -76,18 +88,17 @@ <field name="hradvisees" mapped-by="hradvisor"/> </class> - <class name="FullTimeEmployee" table="employees"> + <class name="FullTimeEmployee"> <inheritance strategy="superclass-table"/> </class> <class name="Insurance" table="insuranceplans"> <inheritance strategy="new-table"> - <discriminator strategy="classname" column="discriminator"/> + <discriminator strategy="class-name" column="discriminator"/> <inheritance/> <field name="insid" column="insid"/> <field name="carrier" column="carrier"/> - <field name="employee" mapped-by="dentalInsurance"/> - <field name="employee" mapped-by="medicalInsurance"/> + <field name="employee" mapped-by="dentalInsurance" mapped-by="medicalInsurance"/> </class> <class name="MedicalInsurance"> @@ -95,39 +106,24 @@ <field name="planType" column="planType"/> </class> - <class name="PartTimeEmployee" table="employees"> + <class name="PartTimeEmployee"> <inheritance strategy="superclass-table"/> </class> <class name="Person" table="employees"> <inheritance strategy="no-table"/> - <field name="middlename"/> - <field name="address"> - <embedded> - <field name="street" column="street"/> - <field name="city" column="city"/> - <field name="state" column="state"/> - <field name="zipcode" column="zipcode"/> - <field name="country" column="country"/> - </embedded> - </field> - <field name="phoneNumbers" > - <join table="employee_phoneno_type" column="personid" target="empid"/> - <key column="type"/> - <value column="phoneno"/> - </field> </class> <class name="Project" table="projects"> <field name="projid" column="projid"/> <field name="name" column="name"/> <field name="budget" column="budget"/> - <field name="reviewers"> - <join table="project_reviewer" column="projid"/> + <field name="reviewers" table="project_reviewer"> + <join column="projid"/> <element column="reviewer"> </field> - <field name="members"> - <join table="project_member" column="projid"/> + <field name="members" table="project_member"> + <join column="projid"/> <element column="member"/> </field> </class>