blob: c22ff5315024753eafdcd09a07d4c78fa0e27d61 [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="2.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_2_0.xsd">
<description>Merge Relationships Test Model Instance Document</description>
<package>org.eclipse.persistence.testing.models.jpa.xml.merge.relationships</package>
<access>PROPERTY</access>
<named-query name="findAllXMLMergeCustomers">
<query>SELECT OBJECT(thecust) FROM XMLMergeCustomer thecust</query>
<hint name="refresh" value="true"/>
</named-query>
<named-query name="findAllXMLMergeOrdersByItem">
<query>SELECT OBJECT(theorder) FROM XMLMergeOrderBean theorder WHERE theorder.item.itemId = :id</query>
</named-query>
<named-query name="findAllXMLMergeItemsByName">
<query>SELECT OBJECT(item) FROM XMLMergeItem item WHERE item.name = ?1</query>
</named-query>
<entity name="XMLMergeCustomer" class="Customer">
<table-generator name="XML_MERGE_CUSTOMER_TABLE_GENERATOR" table="CMP3_XML_MERGE_CUSTOMER_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="CUST_SEQ"/>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
<attributes>
<basic name="city">
<column name="CITY"/>
</basic>
<basic name="name">
<column name="NAME"/>
</basic>
<one-to-many name="orders" target-entity="Order" mapped-by="customer">
<cascade>
<cascade-persist/>
<cascade-remove/>
</cascade>
</one-to-many>
</attributes>
</entity>
<entity name="XMLMergeOrderBean" class="Order" metadata-complete="false">
<table-generator name="XML_MERGE_ORDER_TABLE_GENERATOR" table="CMP3_XML_MERGE_CUSTOMER_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="ORDER_SEQ"/>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
<attributes>
<basic name="quantity"/>
<basic name="shippingAddress">
<column name="SHIP_ADDR"/>
</basic>
<version name="version">
<column name="ORDER_VERSION"/>
</version>
<many-to-one name="customer" target-entity="Customer" fetch="LAZY"/>
<one-to-one name="item" fetch="LAZY">
<join-column name="ITEM_ID"/>
<cascade>
<cascade-persist/>
</cascade>
</one-to-one>
</attributes>
</entity>
<entity name="XMLMergeItem" class="Item" access="FIELD">
<table-generator name="XML_MERGE_ITEM_TABLE_GENERATOR" table="CMP3_XML_MERGE_CUSTOMER_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="ITEM_SEQ"/>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
<attributes>
<basic name="name"/>
<basic name="description" access="PROPERTY"/>
<basic name="image" access="PROPERTY">
<column name="IMAGE" length="1280"/>
<lob/>
</basic>
<version name="version">
<column name="ITEM_VERSION"/>
</version>
<one-to-one name="order" fetch="LAZY" mapped-by="item" access="PROPERTY"/>
<many-to-many name="partsLists" target-entity="PartsList" mapped-by="items" access="PROPERTY"/>
</attributes>
</entity>
<entity name="XMLMergePartsList" class="PartsList">
<table-generator name="XML_MERGE_PARTSLIST_TABLE_GENERATOR" table="CMP3_XML_MERGE_CUSTOMER_SEQ" pk-column-name="SEQ_NAME" value-column-name="SEQ_COUNT" pk-column-value="PARTSLIST_SEQ"/>
<exclude-default-listeners/>
<exclude-superclass-listeners/>
<attributes>
<version name="version">
<column name="VERSION"/>
</version>
<many-to-many name="items" target-entity="Item">
<join-table name="CMP3_XML_MERGE_PARTSLIST_ITEM">
<join-column name="PARTSLIST_ID"/>
<inverse-join-column name="ITEM_ID"/>
</join-table>
<cascade>
<cascade-persist/>
</cascade>
</many-to-many>
</attributes>
</entity>
</entity-mappings>