<?xml version="1.0" encoding="UTF-8"?>
<object>
  <className>Driver</className>
  <tableName>driver</tableName>
  <sequenceName>driver_seq</sequenceName>
  <keyColumnName>driver_id</keyColumnName>

  <!-- include all columns in table, except primary key ( do include foreign key columns) -->
  <column>
    <column_name>first_name</column_name>
    <property>firstName</property>
    <javaDataType>String</javaDataType>
    <treatAs>String</treatAs>
  </column>
  <column>
    <column_name>middle_name</column_name>
    <property>middleName</property>
    <javaDataType>String</javaDataType>
    <treatAs>String</treatAs>
  </column>
  <column>
    <column_name>last_name</column_name>
    <property>lastName</property>
    <javaDataType>String</javaDataType>
    <treatAs>String</treatAs>
  </column>
  <column>
    <column_name>gender</column_name>
    <property>gender</property>
    <javaDataType>String</javaDataType>
    <treatAs>String</treatAs>
  </column>
  <column>
    <column_name>license_points</column_name>
    <property>licensePoints</property>
    <javaDataType>float</javaDataType>
    <treatAs>float</treatAs>
  </column>
  <column>
    <column_name>address_id</column_name>
    <property>addressId</property>
    <javaDataType>long</javaDataType>
    <treatAs>long</treatAs>
  </column>
  <column>
    <column_name>date_of_birth</column_name>
    <property>dateOfBirth</property>
    <javaDataType>GregorianCalendar</javaDataType>
    <treatAs>GregorianCalendar</treatAs>
  </column>
  <column>
    <column_name>contact_info_id</column_name>
    <property>contactInfoId</property>
    <javaDataType>long</javaDataType>
    <treatAs>long</treatAs>
  </column>

  <!--- Note the last two columns are the timestamp when this row was created and the timestamp when -->
  <!--- when it was last modfied.  If you have columns like this make sure they appear last .        -->
  <column>
    <column_name>created</column_name>
    <property>created</property>
    <javaDataType>GregorianCalendar</javaDataType>
    <treatAs>GregorianCalendar</treatAs>
    <sysdateOnInsert/>
    <skipOnUpdate/>
  </column>
  <column>
    <column_name>updated</column_name>
    <property>updated</property>
    <javaDataType>GregorianCalendar</javaDataType>
    <treatAs>GregorianCalendar</treatAs>
    <sysdateOnInsert/>
    <sysdateOnUpdate/>
  </column>

  <!-- Describe an other table that has a one to one relationship with this table.              -->
  <!-- Assumes that this table has foreign key column that points to the other table.           -->
  <!-- By default a parent/child between the two tables is assumed. They are inserted, updated, -->
  <!-- deleted, and selected together.                                                          -->
  <!-- If this is not the case and the row on the other table can exist without this row then   -->
  <!-- include a <readOnly/> tag.  The other table is selected from when this table is          -->
  <!-- selected from - but the other table isn't affected by write operations.                  -->
  <toOneJoinedTable>
    <ClassName>Address</ClassName>
    <InstanceName>address</InstanceName>
    <PropertyName>addressId</PropertyName>                       
    <tableName>driver_address</tableName>                       
    <joinTest>driver.address_id = driver_address.address_id</joinTest>
    <!-- Add these childObjectProperty details if you wish to provide getter and setter methods -->
    <!-- for properties inside the child object.                                                -->
    <column>
      <column_name>address_id</column_name>
      <property>addressId</property>
      <javaDataType>long</javaDataType>
    </column>
    <column>
      <column_name>address_line1</column_name>
      <property>addressLine1</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>address_line2</column_name>
      <property>addressLine2</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>city</column_name>
      <property>city</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>state</column_name>
      <property>state</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>zip</column_name>
      <property>zip</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>date_moved_in</column_name>
      <property>dateMovedIn</property>
      <javaDataType>GregorianCalendar</javaDataType>
    </column>
    <column>
      <column_name>created</column_name>
      <property>created</property>
      <javaDataType>GregorianCalendar</javaDataType>
    </column>
    <column>
      <column_name>updated</column_name>
      <property>updated</property>
      <javaDataType>GregorianCalendar</javaDataType>
    </column>
  </toOneJoinedTable>

  <toOneJoinedTable>
    <ClassName>ContactInfo</ClassName>
    <InstanceName>contactInfo</InstanceName>
    <PropertyName>contactInfoId</PropertyName>                       
    <tableName>contact_info</tableName>                       
    <joinTest>driver.contact_info_id = contact_info.contact_info_id</joinTest>
    <column>
      <column_name>contact_info_id</column_name>
      <property>contactInfoId</property>
      <javaDataType>long</javaDataType>
    </column>
    <column>
      <column_name>home_phone</column_name>
      <property>homePhone</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>work_phone</column_name>
      <property>workPhone</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>email_address</column_name>
      <property>emailAddress</property>
      <javaDataType>String</javaDataType>
      <includeGetSetMethodsFor/>
    </column>
    <column>
      <column_name>created</column_name>
      <property>created</property>
      <javaDataType>GregorianCalendar</javaDataType>
    </column>
    <column>
      <column_name>updated</column_name>
      <property>updated</property>
      <javaDataType>GregorianCalendar</javaDataType>
    </column>
  </toOneJoinedTable>


  <!-- Describe an other table that has a one to many relationship with this table.             -->
  <!-- Many rows on the other table match one row on this table.                                -->
  <toManyJoinedTable>
    <ClassName>Car</ClassName>
    <joinPropertyName>driverId</joinPropertyName>                       
    <tableName>car</tableName>                       
    <joinColumnName>driver_id</joinColumnName>
    <column>
      <column_name>car_id </column_name>
    </column>
    <column>
      <column_name>driver_id</column_name>
    </column>
    <column>
      <column_name>make</column_name>
    </column>
    <column>
      <column_name>model</column_name>
    </column>
    <column>
      <column_name>year</column_name>
    </column>
    <column>
      <column_name>mileage</column_name>
    </column>
    <column>
      <column_name>created</column_name>
    </column>
    <column>
      <column_name>updated</column_name>
    </column>
  </toManyJoinedTable>

</object>






