blob: 452fc0b64d9ca293dd8a3c9111a955b0de516c87 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0,
or the Eclipse Distribution License v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
-->
<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd">
<description>Unidirectional Relationship Test Model Instance Document.</description>
<!--The package subelement is overridden if the fully qualified class name is specified for a class and the two disagree.-->
<package>a.nonexisting.package.to.test.override</package>
<entity name="XMLUniEmployee" class="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Employee" access="PROPERTY">
<table name="CMP3_XML_UNI_EMPLOYEE"/>
<secondary-table name="CMP3_XML_UNI_SALARY"/>
<primary-key-join-column name="EMP_ID" referenced-column-name="EMP_ID"/>
<table-generator name="XML_UNI_EMPLOYEE_TABLE_GENERATOR" table="CMP3_XML_EMPLOYEE_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="UNI_EMPLOYEE_SEQ"/>
<attributes>
<id name="id">
<column name="EMP_ID"/>
<generated-value strategy="TABLE" generator="XML_UNI_EMPLOYEE_TABLE_GENERATOR"/>
</id>
<basic name="firstName">
<column name="F_NAME"/>
</basic>
<basic name="lastName">
<column name="L_NAME"/>
</basic>
<basic name="salary">
<column table="CMP3_XML_UNI_SALARY"/>
</basic>
<version name="version">
<column name="VERSION"/>
</version>
<!--unidirectional many-to-one mapping-->
<many-to-one name="address" target-entity="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Address" fetch="LAZY">
<join-column name="ADDR_ID"/>
<cascade>
<cascade-persist/>
</cascade>
</many-to-one>
<many-to-one name="manager" target-entity="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Employee" fetch="LAZY">
<join-column name="MANAGER_EMP_ID" referenced-column-name="EMP_ID"/>
<cascade>
<cascade-persist/>
</cascade>
</many-to-one>
<!--unidirectional one-to-many mapping-->
<one-to-many name="phoneNumbers" target-entity="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.PhoneNumber">
<join-table name="CMP3_XML_UNI_EMP_PHONE">
<join-column name="EMP_ID" referenced-column-name="EMP_ID"/>
<inverse-join-column name="PHONE_ID" referenced-column-name="PHONE_ID"/>
</join-table>
<cascade>
<!--cascade-all/-->
<cascade-persist/>
</cascade>
</one-to-many>
<one-to-many name="managedEmployees" target-entity="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Employee" mapped-by="manager">
<cascade>
<cascade-all/>
</cascade>
</one-to-many>
<!--unidirectional many-to-many mapping-->
<many-to-many name="projects" target-entity="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Project">
<order-by>name</order-by>
<join-table name="CMP3_XML_UNI_PROJ_EMP">
<join-column name="EMP_ID" referenced-column-name="EMP_ID"/>
<inverse-join-column name="PROJ_ID" referenced-column-name="PROJ_ID"/>
</join-table>
<cascade>
<cascade-persist/>
</cascade>
</many-to-many>
<embedded name="period">
<attribute-override name="startDate">
<column name="START_DATE" nullable="false"/>
</attribute-override>
<attribute-override name="endDate">
<column name="END_DATE" nullable="true"/>
</attribute-override>
</embedded>
</attributes>
</entity>
<entity name="XMLUniAddress" class="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Address" access="PROPERTY">
<table name="CMP3_XML_UNI_ADDRESS"/>
<table-generator name="XML_UNI_ADDRESS_TABLE_GENERATOR" table="CMP3_XML_EMPLOYEE_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="UNI_ADDRESS_SEQ"/>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
<attributes>
<id name="id">
<column name="ADDRESS_ID"/>
<generated-value strategy="TABLE" generator="XML_UNI_ADDRESS_TABLE_GENERATOR"/>
</id>
<basic name="postalCode">
<column name="P_CODE"/>
</basic>
<basic name="street"/>
<basic name="city"/>
<basic name="province"/>
<basic name="country"/>
</attributes>
</entity>
<entity name="XMLUniPhoneNumber" class="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.PhoneNumber" access="PROPERTY">
<table name="CMP3_XML_UNI_PHONENUMBER"/>
<table-generator name="XML_UNI_PHONE_TABLE_GENERATOR" table="CMP3_XML_EMPLOYEE_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="UNI_PHONE_SEQ"/>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
<attributes>
<id name="id">
<column name="PHONE_ID"/>
<generated-value strategy="TABLE" generator="XML_UNI_PHONE_TABLE_GENERATOR"/>
</id>
<basic name="type">
<column name="TYPE"/>
</basic>
<basic name="number">
<column name="NUMB"/>
</basic>
<basic name="areaCode">
<column name="AREA_CODE"/>
</basic>
</attributes>
</entity>
<entity name="XMLUniLargeProject" class="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.LargeProject" access="PROPERTY">
<table name="CMP3_XML_UNI_LPROJECT"/>
<discriminator-value>L</discriminator-value>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
</entity>
<entity name="XMLUniSmallProject" class="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.SmallProject" access="PROPERTY">
<table name="CMP3_XML_UNI_PROJECT"/>
<discriminator-value>S</discriminator-value>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
</entity>
<entity name="XMLUniProject" class="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Project" access="PROPERTY">
<table name="CMP3_XML_UNI_PROJECT"/>
<inheritance strategy="JOINED"/>
<discriminator-value>P</discriminator-value>
<discriminator-column name="PROJ_TYPE"/>
<table-generator name="XML_UNI_PROJECT_TABLE_GENERATOR" table="CMP3_XML_EMPLOYEE_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="UNI_PROJECT_SEQ"/>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
<pre-persist method-name="prePersist"/>
<post-persist method-name="postPersist"/>
<pre-remove method-name="preRemove"/>
<post-remove method-name="postRemove"/>
<pre-update method-name="preUpdate"/>
<post-update method-name="postUpdate"/>
<post-load method-name="postLoad"/>
<attributes>
<id name="id">
<column name="PROJ_ID"/>
<generated-value strategy="TABLE" generator="XML_UNI_PROJECT_TABLE_GENERATOR"/>
</id>
<basic name="name">
<column name="PROJ_NAME"/>
</basic>
<basic name="description">
<column name="DESCRIP"/>
</basic>
<version name="version">
<column name="VERSION"/>
</version>
<!--unidirectional one-to-one mapping-->
<one-to-one name="teamLeader" target-entity="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.Employee">
<join-column name="LEADER_ID"/>
</one-to-one>
</attributes>
</entity>
<embeddable class="org.eclipse.persistence.testing.models.jpa.xml.relationships.unidirectional.EmploymentPeriod" access="PROPERTY">
<attributes>
<basic name="startDate">
<column name="S_DATE"/>
</basic>
<basic name="endDate">
<column name="E_DATE"/>
</basic>
</attributes>
</embeddable>
</entity-mappings>