| <?xml version="1.0" encoding="UTF-8"?> |
| <object-persistence version="1.1.2" |
| xmlns="http://www.eclipse.org/eclipselink/xsds/persistence" xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:eclipselink="http://www.eclipse.org/eclipselink/xsds/persistence"> |
| <name>Employee</name> |
| <class-mapping-descriptors> |
| <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor"> |
| <class>model.dynamic.employee.Address</class> |
| <alias>Address</alias> |
| <primary-key> |
| <field table="DX_ADDRESS" name="ADDRESS_ID" xsi:type="column" /> |
| </primary-key> |
| <events xsi:type="event-policy" /> |
| <querying xsi:type="query-policy" /> |
| <attribute-mappings> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>city</attribute-name> |
| <field table="DX_ADDRESS" name="CITY" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>country</attribute-name> |
| <field table="DX_ADDRESS" name="COUNTRY" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>id</attribute-name> |
| <field table="DX_ADDRESS" name="ADDRESS_ID" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>postalCode</attribute-name> |
| <field table="DX_ADDRESS" name="P_CODE" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>province</attribute-name> |
| <field table="DX_ADDRESS" name="PROVINCE" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>street</attribute-name> |
| <field table="DX_ADDRESS" name="STREET" xsi:type="column" /> |
| </attribute-mapping> |
| </attribute-mappings> |
| <descriptor-type>independent</descriptor-type> |
| <sequencing> |
| <sequence-name>DX_ADDRESS_SEQ</sequence-name> |
| <sequence-field table="DX_ADDRESS" name="ADDRESS_ID" |
| xsi:type="column" /> |
| </sequencing> |
| <instantiation /> |
| <copying xsi:type="instantiation-copy-policy" /> |
| <tables> |
| <table name="DX_ADDRESS" /> |
| </tables> |
| </class-mapping-descriptor> |
| <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor"> |
| <class>model.dynamic.employee.Employee</class> |
| <alias>Employee</alias> |
| <primary-key> |
| <field table="DX_EMPLOYEE" name="EMP_ID" xsi:type="column" /> |
| </primary-key> |
| <events xsi:type="event-policy" /> |
| <querying xsi:type="query-policy" /> |
| <attribute-mappings> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>firstName</attribute-name> |
| <field table="DX_EMPLOYEE" name="F_NAME" xsi:type="column" /> |
| <null-value xsi:type="xsd:string"></null-value> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>id</attribute-name> |
| <field table="DX_EMPLOYEE" name="EMP_ID" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>lastName</attribute-name> |
| <field table="DX_EMPLOYEE" name="L_NAME" xsi:type="column" /> |
| <null-value xsi:type="xsd:string"></null-value> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>salary</attribute-name> |
| <field table="DX_SALARY" name="SALARY" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>gender</attribute-name> |
| <field table="DX_EMPLOYEE" name="GENDER" xsi:type="column" /> |
| <converter xsi:type="object-type-converter"> |
| <type-mappings> |
| <type-mapping> |
| <object-value xsi:type="xsd:string">Male</object-value> |
| <data-value xsi:type="xsd:string">M</data-value> |
| </type-mapping> |
| <type-mapping> |
| <object-value xsi:type="xsd:string">Female</object-value> |
| <data-value xsi:type="xsd:string">F</data-value> |
| </type-mapping> |
| </type-mappings> |
| </converter> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="aggregate-object-mapping"> |
| <attribute-name>period</attribute-name> |
| <reference-class>model.dynamic.employee.EmploymentPeriod</reference-class> |
| <field-translations> |
| <field-translation> |
| <source-field name="startDate->DIRECT" xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="START_DATE" |
| xsi:type="column" /> |
| </field-translation> |
| <field-translation> |
| <source-field name="endDate->DIRECT" xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="END_DATE" |
| xsi:type="column" /> |
| </field-translation> |
| </field-translations> |
| </attribute-mapping> |
| <!-- DirectCollection from XML does not work |
| <attribute-mapping xsi:type="direct-collection-mapping"> |
| <attribute-name>responsibilitiesList</attribute-name> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="direct-read-query"> |
| <maintain-cache>false</maintain-cache> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| </selection-query> |
| <reference-table>DX_RESPONS</reference-table> |
| <direct-field table="DX_RESPONS" name="DESCRIP" xsi:type="column" /> |
| <reference-foreign-key> |
| <field-reference> |
| <source-field table="DX_RESPONS" name="EMP_ID" |
| xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </reference-foreign-key> |
| </attribute-mapping> |
| --> |
| <attribute-mapping xsi:type="one-to-one-mapping"> |
| <attribute-name>address</attribute-name> |
| <reference-class>model.dynamic.employee.Address</reference-class> |
| <private-owned>true</private-owned> |
| <foreign-key> |
| <field-reference> |
| <source-field table="DX_EMPLOYEE" name="ADDR_ID" |
| xsi:type="column" /> |
| <target-field table="DX_ADDRESS" name="ADDRESS_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </foreign-key> |
| <foreign-key-fields> |
| <field table="DX_EMPLOYEE" name="ADDR_ID" xsi:type="column" /> |
| </foreign-key-fields> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="read-object-query"> |
| <reference-class>model.dynamic.employee.Address</reference-class> |
| </selection-query> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="one-to-one-mapping"> |
| <attribute-name>manager</attribute-name> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| <foreign-key> |
| <field-reference> |
| <source-field table="DX_EMPLOYEE" name="MANAGER_ID" |
| xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </foreign-key> |
| <foreign-key-fields> |
| <field table="DX_EMPLOYEE" name="MANAGER_ID" xsi:type="column" /> |
| </foreign-key-fields> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="read-object-query"> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| </selection-query> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="one-to-many-mapping"> |
| <attribute-name>managedEmployees</attribute-name> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| <target-foreign-key> |
| <field-reference> |
| <source-field table="DX_EMPLOYEE" name="MANAGER_ID" |
| xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </target-foreign-key> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="read-all-query"> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| </selection-query> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="one-to-many-mapping"> |
| <attribute-name>phoneNumbers</attribute-name> |
| <reference-class>model.dynamic.employee.PhoneNumber</reference-class> |
| <private-owned>true</private-owned> |
| <target-foreign-key> |
| <field-reference> |
| <source-field table="DX_PHONE" name="EMP_ID" xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </target-foreign-key> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="read-all-query"> |
| <reference-class>model.dynamic.employee.PhoneNumber</reference-class> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| </selection-query> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="many-to-many-mapping"> |
| <attribute-name>projects</attribute-name> |
| <reference-class>model.dynamic.employee.Project</reference-class> |
| <relation-table>DX_PROJ_EMP</relation-table> |
| <source-relation-foreign-key> |
| <field-reference> |
| <source-field table="DX_PROJ_EMP" name="EMP_ID" |
| xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </source-relation-foreign-key> |
| <target-relation-foreign-key> |
| <field-reference> |
| <source-field table="DX_PROJ_EMP" name="PROJ_ID" |
| xsi:type="column" /> |
| <target-field table="DX_PROJECT" name="PROJ_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </target-relation-foreign-key> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="read-all-query"> |
| <reference-class>model.dynamic.employee.Project</reference-class> |
| <container xsi:type="list-container-policy"> |
| <collection-type>java.util.Vector</collection-type> |
| </container> |
| </selection-query> |
| <insert-query xsi:type="data-modify-query" /> |
| <delete-query xsi:type="data-modify-query" /> |
| <delete-all-query xsi:type="data-modify-query" /> |
| </attribute-mapping> |
| </attribute-mappings> |
| <descriptor-type>independent</descriptor-type> |
| <interfaces> |
| </interfaces> |
| <locking xsi:type="version-locking-policy"> |
| <version-field table="DX_EMPLOYEE" name="VERSION" |
| xsi:type="column" /> |
| </locking> |
| <sequencing> |
| <sequence-name>DX_EMP_SEQ</sequence-name> |
| <sequence-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </sequencing> |
| <instantiation /> |
| <copying xsi:type="instantiation-copy-policy" /> |
| <tables> |
| <table name="DX_EMPLOYEE" /> |
| <table name="DX_SALARY" /> |
| </tables> |
| </class-mapping-descriptor> |
| <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor"> |
| <class>model.dynamic.employee.EmploymentPeriod</class> |
| <alias>EmploymentPeriod</alias> |
| <events xsi:type="event-policy" /> |
| <querying xsi:type="query-policy" /> |
| <attribute-mappings> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>endDate</attribute-name> |
| <field name="endDate->DIRECT" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>startDate</attribute-name> |
| <field name="startDate->DIRECT" xsi:type="column" /> |
| </attribute-mapping> |
| </attribute-mappings> |
| <descriptor-type>aggregate</descriptor-type> |
| <instantiation /> |
| <copying xsi:type="instantiation-copy-policy" /> |
| </class-mapping-descriptor> |
| <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor"> |
| <class>model.dynamic.employee.LargeProject</class> |
| <alias>LargeProject</alias> |
| <inheritance xsi:type="inheritance-policy"> |
| <parent-class>model.dynamic.employee.Project</parent-class> |
| <read-subclasses-on-queries>false</read-subclasses-on-queries> |
| </inheritance> |
| <events xsi:type="event-policy" /> |
| <querying xsi:type="query-policy" /> |
| <attribute-mappings> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>budget</attribute-name> |
| <field table="DX_LPROJECT" name="BUDGET" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>milestoneVersion</attribute-name> |
| <field table="DX_LPROJECT" name="MILESTONE" xsi:type="column" /> |
| </attribute-mapping> |
| </attribute-mappings> |
| <descriptor-type>independent</descriptor-type> |
| <interfaces> |
| </interfaces> |
| <instantiation /> |
| <copying xsi:type="instantiation-copy-policy" /> |
| <tables> |
| <table name="DX_LPROJECT" /> |
| </tables> |
| </class-mapping-descriptor> |
| <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor"> |
| <class>model.dynamic.employee.PhoneNumber</class> |
| <alias>PhoneNumber</alias> |
| <primary-key> |
| <field table="DX_PHONE" name="EMP_ID" xsi:type="column" /> |
| <field table="DX_PHONE" name="TYPE" xsi:type="column" /> |
| </primary-key> |
| <events xsi:type="event-policy" /> |
| <querying xsi:type="query-policy"> |
| <queries> |
| <query name="localNumbers" xsi:type="read-object-query"> |
| <criteria operator="and" xsi:type="logic-expression"> |
| <left operator="equal" xsi:type="relation-expression"> |
| <left name="id" xsi:type="query-key-expression"> |
| <base xsi:type="base-expression" /> |
| </left> |
| <right xsi:type="parameter-expression"> |
| <parameter name="ID" xsi:type="column" /> |
| </right> |
| </left> |
| <right operator="equal" xsi:type="relation-expression"> |
| <left name="areaCode" xsi:type="query-key-expression"> |
| <base xsi:type="base-expression" /> |
| </left> |
| <right xsi:type="constant-expression"> |
| <value xsi:type="xsd:string">613</value> |
| </right> |
| </right> |
| </criteria> |
| <arguments> |
| <argument name="ID"> |
| <type>java.lang.Number</type> |
| </argument> |
| </arguments> |
| <reference-class>model.dynamic.employee.PhoneNumber</reference-class> |
| <cache-usage>primary-key</cache-usage> |
| <lock-mode>none</lock-mode> |
| </query> |
| </queries> |
| </querying> |
| <attribute-mappings> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>areaCode</attribute-name> |
| <field table="DX_PHONE" name="AREA_CODE" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>number</attribute-name> |
| <field table="DX_PHONE" name="P_NUMBER" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>type</attribute-name> |
| <field table="DX_PHONE" name="TYPE" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="one-to-one-mapping"> |
| <attribute-name>owner</attribute-name> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| <foreign-key> |
| <field-reference> |
| <source-field table="DX_PHONE" name="EMP_ID" xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </foreign-key> |
| <foreign-key-fields> |
| <field table="DX_PHONE" name="EMP_ID" xsi:type="column" /> |
| </foreign-key-fields> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="read-object-query"> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| </selection-query> |
| </attribute-mapping> |
| </attribute-mappings> |
| <descriptor-type>independent</descriptor-type> |
| <instantiation /> |
| <copying xsi:type="instantiation-copy-policy" /> |
| <query-keys> |
| <query-key name="id" xsi:type="direct-query-key"> |
| <field table="DX_PHONE" name="EMP_ID" xsi:type="column" /> |
| </query-key> |
| </query-keys> |
| <tables> |
| <table name="DX_PHONE" /> |
| </tables> |
| </class-mapping-descriptor> |
| <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor"> |
| <class>model.dynamic.employee.Project</class> |
| <alias>Project</alias> |
| <primary-key> |
| <field table="DX_PROJECT" name="PROJ_ID" xsi:type="column" /> |
| </primary-key> |
| <inheritance xsi:type="inheritance-policy"> |
| <class-indicator-field table="DX_PROJECT" name="PROJ_TYPE" |
| xsi:type="column" /> |
| <class-indicator-mappings> |
| <class-indicator-mapping> |
| <class>model.dynamic.employee.SmallProject</class> |
| <class-indicator xsi:type="xsd:string">S</class-indicator> |
| </class-indicator-mapping> |
| <class-indicator-mapping> |
| <class>model.dynamic.employee.LargeProject</class> |
| <class-indicator xsi:type="xsd:string">L</class-indicator> |
| </class-indicator-mapping> |
| </class-indicator-mappings> |
| </inheritance> |
| <events xsi:type="event-policy" /> |
| <querying xsi:type="query-policy" /> |
| <attribute-mappings> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>description</attribute-name> |
| <field table="DX_PROJECT" name="DESCRIP" xsi:type="column" /> |
| <null-value xsi:type="xsd:string"></null-value> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>id</attribute-name> |
| <field table="DX_PROJECT" name="PROJ_ID" xsi:type="column" /> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="direct-mapping"> |
| <attribute-name>name</attribute-name> |
| <field table="DX_PROJECT" name="PROJ_NAME" xsi:type="column" /> |
| <null-value xsi:type="xsd:string"></null-value> |
| </attribute-mapping> |
| <attribute-mapping xsi:type="one-to-one-mapping"> |
| <attribute-name>teamLeader</attribute-name> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| <foreign-key> |
| <field-reference> |
| <source-field table="DX_PROJECT" name="LEADER_ID" |
| xsi:type="column" /> |
| <target-field table="DX_EMPLOYEE" name="EMP_ID" |
| xsi:type="column" /> |
| </field-reference> |
| </foreign-key> |
| <foreign-key-fields> |
| <field table="DX_PROJECT" name="LEADER_ID" xsi:type="column" /> |
| </foreign-key-fields> |
| <indirection xsi:type="value-holder-indirection-policy" /> |
| <selection-query xsi:type="read-object-query"> |
| <reference-class>model.dynamic.employee.Employee</reference-class> |
| </selection-query> |
| </attribute-mapping> |
| </attribute-mappings> |
| <descriptor-type>independent</descriptor-type> |
| <interfaces> |
| </interfaces> |
| <locking xsi:type="version-locking-policy"> |
| <version-field table="DX_PROJECT" name="VERSION" |
| xsi:type="column" /> |
| </locking> |
| <sequencing> |
| <sequence-name>DX_PROJ_SEQ</sequence-name> |
| <sequence-field table="DX_PROJECT" name="PROJ_ID" |
| xsi:type="column" /> |
| </sequencing> |
| <instantiation /> |
| <copying xsi:type="instantiation-copy-policy" /> |
| <tables> |
| <table name="DX_PROJECT" /> |
| </tables> |
| </class-mapping-descriptor> |
| <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor"> |
| <class>model.dynamic.employee.SmallProject</class> |
| <alias>SmallProject</alias> |
| <inheritance xsi:type="inheritance-policy"> |
| <parent-class>model.dynamic.employee.Project</parent-class> |
| <read-subclasses-on-queries>false</read-subclasses-on-queries> |
| </inheritance> |
| <events xsi:type="event-policy" /> |
| <querying xsi:type="query-policy" /> |
| <descriptor-type>independent</descriptor-type> |
| <interfaces> |
| </interfaces> |
| <instantiation /> |
| <copying xsi:type="instantiation-copy-policy" /> |
| <tables> |
| <table name="DX_PROJECT" /> |
| </tables> |
| </class-mapping-descriptor> |
| </class-mapping-descriptors> |
| </object-persistence> |