In JDO, we define the persistence definition using metadata in XML format. Presented below is an example metadata file for two classes.

Java Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jdo SYSTEM "jdo.dtd">
<jdo>
  <package name="com.xyz.hr">
    <class name="Employee" identity-type="application" objectidclass="EmployeeKey">
      <field name="name" primary-key="true">
        <extension vendor-name="sunw" key="index" value="btree"/>
      </field>
      <field name="salary" default-fetch-group="true"/>
      <field name="dept">
        <extension vendor-name="sunw" key="inverse" value="emps"/>
      </field>
      <field name="boss"/>
    </class>

    <class name="Department" identity-type="application" objectidclass="DepartmentKey">
      <field name="name" primary-key="true"/>
      <field name="emps">
        <collection element-type="Employee">
          <extension vendor-name="sunw" key="element-inverse" value="dept"/>
        </collection>
      </field>
    </class>
  </package>
</jdo>