<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-->
<!-- AtestCatalog metadata in xml -->
<entity-mappings 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"
version="2.0">
	<package>embeddableXml</package>

    <entity name="EntityA_Coll_StringXml" 
            class="org.apache.openjpa.persistence.embed.EntityA_Coll_StringXml" 
            access="FIELD">
        <table name="EntityA_Coll_String_XML" />
        
        <attributes>
            <id name="id">
            </id>
            
            <basic name="name">
                <column length="30" />
            </basic>
            
            <basic name="age" fetch="LAZY">
            </basic>
            
            <element-collection name="nickNames">
              <column name="nickName_xml" length="20"/>
              <collection-table name="NickNames_xml">
                 <join-column name="A_ID_xml" nullable="false"/>
                 <unique-constraint>
                   <column-name>A_ID_xml</column-name>
                    <column-name>nickName_xml</column-name>
                 </unique-constraint>
              </collection-table>
	        </element-collection>
        </attributes>
    </entity>
     
    <entity name="EntityA_Coll_Embed_EmbedXml" 
            class="org.apache.openjpa.persistence.embed.EntityA_Coll_Embed_EmbedXml" 
            access="FIELD">
        <table name="EntityA_Coll_Embed_EmbedXML" />
        <attributes>
            <id name="id">
            </id>
            <basic name="name">
                <column length="30" />
            </basic>
            <basic name="age" fetch="LAZY">
            </basic>
            <element-collection name="embeds">
            </element-collection>
        </attributes>
    </entity>
 
 	<entity name="DepartmentXml"
		class="org.apache.openjpa.persistence.embed.DepartmentXml"
		access="FIELD">
		<attributes>
			<id name="deptId"></id>
			<one-to-many name="empMap">
				<map-key name="empId" />
				<cascade>
					<cascade-all />
				</cascade>
			</one-to-many>
		</attributes>
	</entity>

	<entity name="EmployeeXml"
		class="org.apache.openjpa.persistence.embed.EmployeeXml"
		access="FIELD">
		<attributes>
			<id name="empId"></id>
			<many-to-one name="department">
				<join-column name="dept_id" />
			</many-to-one>
		</attributes>
	</entity>

	<entity name="ItemXml"
		class="org.apache.openjpa.persistence.embed.ItemXml" access="FIELD">
		<attributes>
			<id name="id"></id>
			<element-collection name="images"
				target-class="java.lang.String">
				<map-key-class class="java.lang.String" />
				<map-key-column name="IMAGE_NAME" />
                <column name="IMAGE_FILENAME" />
				<collection-table name="IMAGE_XML" />
			</element-collection>
		</attributes>
	</entity>

	<entity name="DivisionXml"
		class="org.apache.openjpa.persistence.embed.DivisionXml"
		access="FIELD">
		<attributes>
			<id name="id"></id>
			<basic name="name" />
		</attributes>
	</entity>

	<entity name="VicePresidentXml"
		class="org.apache.openjpa.persistence.embed.VicePresidentXml"
		access="FIELD">
		<attributes>
			<id name="id"></id>
			<basic name="name" />
		</attributes>
	</entity>

	<entity name="CompanyXml"
		class="org.apache.openjpa.persistence.embed.CompanyXml"
		access="FIELD">
		<attributes>
			<id name="id"></id>
			<one-to-many name="organization">
				<map-key-join-column name="DIVISION" />
				<join-table name="COMPANY_ORG_XML">
					<join-column name="COMPANY" />
					<inverse-join-column name="VP" />
				</join-table>
			</one-to-many>
		</attributes>
	</entity>

	<entity name="CustomerXml"
		class="org.apache.openjpa.persistence.embed.CustomerXml"
		access="FIELD">
		<table name="Customer_XML" />
		<attributes>
			<id name="id"></id>
			<basic name="name" />
			<one-to-many name="orders" mapped-by="cust"
				orphan-removal="true" />
		</attributes>
	</entity>

	<entity name="OrderXml"
		class="org.apache.openjpa.persistence.embed.OrderXml"
		access="FIELD">
		<table name="Order_XML" />
		<attributes>
			<id name="id"></id>
			<basic name="description" />
			<many-to-one name="cust">
				<join-column name="CUST_ID" nullable="false" />
			</many-to-one>
		</attributes>
	</entity>

    <entity name="CustomerXml1" 
        class="org.apache.openjpa.persistence.embed.attrOverrides.CustomerXml" 
        access="FIELD">
        <attributes>
            <id name="id"><column length="12"/></id>
            <basic name="name"><column length="12"/></basic>
            <embedded name="address">
                <attribute-override name="state">
                    <column name="ADDR_STATE" />
                </attribute-override>
                <attribute-override name="zipcode.zip">
                    <column name="ADDR_ZIP" />
                </attribute-override>
            </embedded>
        </attributes>
    </entity>

    <entity name="BasicEntityXML"
        class="org.apache.openjpa.persistence.embed.attrOverrides.BasicEntityXML">
        <attributes>
            <id name="id" />
            <element-collection name="listIntAttrOverEmbed" fetch="EAGER">
                <order-column name="valueOrderColumn" />
                <attribute-override name="intValue">
                    <column name="intValueAttributeOverride" />
                </attribute-override>
                <collection-table name="listIntAttrOverEmbedColTable">
                    <join-column name="parent_id" />
                </collection-table>
            </element-collection>
        </attributes>
    </entity>
    
    <entity name="XMLOverEntity"
        class="org.apache.openjpa.persistence.embed.attrOverrides.XMLOverEntity"
        access="FIELD">
        <attributes>
            <id name="id"/>
            <embedded name="embed">
                <attribute-override name="intEmbed">
                   <column name="intOverEmbed"/>
                </attribute-override>
                <attribute-override name="strEmbed">
                   <column name="strOverEmbed"/>
                </attribute-override>
            </embedded>
        </attributes>
    </entity>    

	<entity class="org.apache.openjpa.persistence.embed.FeatureXml">
		<table name="features" />
		<attributes>
			<embedded-id name="id" />
			<element-collection name="attributes">
				<collection-table name="qualifiers">
					<join-column name="FEATURE_INDEX" referenced-column-name = "index"/>
					<join-column name="FEATURE_OID" referenced-column-name="oid"  />
				</collection-table>
			</element-collection>
		</attributes>
	</entity>     

	<embeddable class="org.apache.openjpa.persistence.embed.AttributeXml">
		<attributes>
			<basic name="name"></basic>
			<basic name="value"></basic>
		</attributes>
	</embeddable>

	<embeddable class="org.apache.openjpa.persistence.embed.FeatureIdXml">
		<attributes>
			<basic name="oid"></basic>
			<basic name="index"></basic>
		</attributes>
	</embeddable>

    <embeddable 
        class="org.apache.openjpa.persistence.embed.attrOverrides.AddressXml" 
        access="FIELD">
        <attributes>
            <basic name="street"><column length="12"/>
            </basic>
            <basic name="city"><column length="12"/></basic>
            <basic name="state"><column length="12"/></basic>
            <embedded name="zipcode"/>
        </attributes>
    </embeddable>

    <embeddable 
        class="org.apache.openjpa.persistence.embed.attrOverrides.ZipcodeXml" 
        access="FIELD">
        <attributes>
            <basic name="zip"><column length="12"/></basic>
            <basic name="plusFour"><column length="12"/></basic>
        </attributes>
    </embeddable>

	<embeddable
		class="org.apache.openjpa.persistence.embed.Embed_EmbedXml"
		access="FIELD">
		<attributes>
			<basic name="intVal1"></basic>
			<basic name="intVal2"></basic>
			<basic name="intVal3"></basic>
			<embedded name="embed">
				<attribute-override name="intVal1">
					<column name="embed_intVal1" />
				</attribute-override>
				<attribute-override name="intVal2">
					<column name="embed_intVal2" />
				</attribute-override>
				<attribute-override name="intVal3">
					<column name="embed_intVal3" />
				</attribute-override>
			</embedded>
		</attributes>
	</embeddable>

	<embeddable class="org.apache.openjpa.persistence.embed.EmbedXml"
		access="FIELD"  metadata-complete="true"/>

    <embeddable class="org.apache.openjpa.persistence.embed.attrOverrides.BasicEmbedXML">
        <attributes>
            <basic name="intValue">
                <column name="shouldNotExist" />
            </basic>
        </attributes>
    </embeddable>    
</entity-mappings>