<?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.
-->
<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">
    <mapped-superclass
        class=
        "org.apache.openjpa.persistence.access.xml.XMLAbstractMappedSuperField"
        access="FIELD">
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="name" access="FIELD"/>
        </attributes>
    </mapped-superclass>
    <mapped-superclass
        class=
        "org.apache.openjpa.persistence.access.xml.XMLAbstractMappedSuperProperty"
        access="PROPERTY">
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="name" access="PROPERTY"/>
            <transient name="createDate"/>
        </attributes>
    </mapped-superclass>
    <mapped-superclass
        class="org.apache.openjpa.persistence.access.xml.XMLMappedSuperField"
        access="FIELD">
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="name" access="FIELD"/>
            <transient name="crtDate"/>
        </attributes>
    </mapped-superclass>
    <mapped-superclass
        class="org.apache.openjpa.persistence.access.xml.XMLMappedSuperProperty"
        access="PROPERTY">
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="name" access="PROPERTY"/>
        </attributes>
    </mapped-superclass>
    <mapped-superclass
        class="org.apache.openjpa.persistence.access.xml.XMLMixedMappedSuper"
        access="PROPERTY">
        <attributes>
            <id name="mid" access="FIELD">
                <generated-value/>
            </id>
            <basic name="name" access="PROPERTY"/>
            <transient name="id"/>            
        </attributes>
    </mapped-superclass>

    <entity name="XMLFieldAccess" 
            class="org.apache.openjpa.persistence.access.xml.XMLFieldAccess" 
            access="FIELD">
        <named-query name="XMLFieldAccess.query">
            <query>SELECT xfa FROM XMLFieldAccess xfa WHERE 
            xfa.id = :id AND xfa.strField = :strVal
            </query>
        </named-query>
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="strField"/>
            <version name="version"/>
        </attributes>
    </entity>    
    <entity name="XMLPropAccess" 
            class="org.apache.openjpa.persistence.access.xml.XMLPropAccess" 
            access="PROPERTY">
        <named-query name="XMLPropAccess.query">
            <query>SELECT xpa FROM XMLPropAccess xpa WHERE 
            xpa.id = :id AND xpa.strProp = :strVal
            </query>
        </named-query>
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="strProp"/>            
            <version name="version"/>
        </attributes>
    </entity>    
    <entity name="XMLDFMPA"
        class=
        "org.apache.openjpa.persistence.access.xml.XMLDefFieldMixedPropAccess"
        access="FIELD">
        <named-query name="XMLDFMPA.query">
            <query>SELECT df FROM XMLDFMPA df WHERE 
            df.id = :id AND df.stringField = :strVal
            </query>
        </named-query>
        <named-query name="XMLDFMPA.badQuery">
            <query>SELECT p FROM XMLDFMPA p WHERE 
            p.id = :id AND p.strField = :strVal
            </query>
        </named-query>
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="stringField" access="PROPERTY"/>            
            <version name="version"/>
            <transient name="strField"/>
        </attributes>
    </entity>    
    <entity name="XMLDPMFA"
        class=
        "org.apache.openjpa.persistence.access.xml.XMLDefPropMixedFieldAccess"
        access="PROPERTY">
        <named-query name="XMLDPMFA.query">
            <query>SELECT dp FROM XMLDPMFA dp WHERE 
            dp.id = :id AND dp.strField = :strVal
            </query>
        </named-query>
        <named-query name="XMLDPMFA.badQuery">
            <query>SELECT p FROM XMLDPMFA p WHERE 
            p.id = :id AND p.strProp = :strVal
            </query>
        </named-query>
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="strField" access="FIELD"/>            
            <version name="version"/>
            <transient name="strProp"/>
        </attributes>
    </entity>    
    
    <entity name="XMLPropertySub"
        class="org.apache.openjpa.persistence.access.xml.XMLPropertySub"
        access="PROPERTY">
        <named-query name="XMLPropertySub.query">
            <query>SELECT ps FROM XMLPropertySub ps WHERE
            ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
            </query>
        </named-query>
        <named-query name="XMLPropertySub.badQuery">
            <query>SELECT ps FROM XMLPropertySub ps WHERE
            ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <basic name="createDate">
                <temporal>TIMESTAMP</temporal>
            </basic>
        </attributes>
    </entity>
        <entity name="XMLFieldSub"
        class="org.apache.openjpa.persistence.access.xml.XMLFieldSub"
        access="FIELD">
        <named-query name="XMLFieldSub.query">
            <query>SELECT fs FROM XMLFieldSub fs WHERE
            fs.id = :id AND fs.name = :name AND fs.crtDate = :crtDate
            </query>
        </named-query>
        <named-query name="XMLFieldSub.badQuery">
            <query>SELECT fs FROM XMLFieldSub fs WHERE
            fs.id = :id AND fs.name = :name AND fs.createDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <basic name="crtDate">
                <temporal>TIMESTAMP</temporal>
            </basic>
        </attributes>
    </entity>
    <entity name="XMLPropertySub2"
        class="org.apache.openjpa.persistence.access.xml.XMLPropertySub2"
        access="PROPERTY">
        <named-query name="XMLPropertySub2.query">
            <query>SELECT ps FROM XMLPropertySub2 ps WHERE 
            ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
            </query>
        </named-query>
        <named-query name="XMLPropertySub2.badQuery">
            <query>SELECT ps FROM XMLPropertySub2 ps WHERE
            ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <basic name="createDate">
                <temporal>TIMESTAMP</temporal>
            </basic>
        </attributes>
    </entity>
    <entity name="XMLFieldSub2"
        class="org.apache.openjpa.persistence.access.xml.XMLFieldSub2"
        access="FIELD">
        <named-query name="XMLFieldSub2.query">
            <query>SELECT ps FROM XMLFieldSub2 ps WHERE 
            ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
            </query>
        </named-query>
        <named-query name="XMLFieldSub2.badQuery">
            <query>SELECT ps FROM XMLFieldSub2 ps WHERE
            ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <basic name="crtDate">
                <temporal>TIMESTAMP</temporal>
            </basic>
        </attributes>
    </entity>
    <entity name="XMLMixedFieldSub"
        class="org.apache.openjpa.persistence.access.xml.XMLMixedFieldSub"
        access="FIELD">
        <named-query name="XMLMixedFieldSub.query">
            <query>SELECT fs FROM XMLMixedFieldSub fs WHERE 
            fs.mid = :id AND fs.name = :name AND fs.createDate = :crtDate
            AND fs.myField = :myField
            </query>
        </named-query>
        <named-query name="XMLMixedFieldSub.badQuery">
            <query>SELECT fs FROM XMLMixedFieldSub fs WHERE
            fs.mid = :id AND fs.name = :name AND fs.myFieldProp = :myField
            </query>
        </named-query>
        <attributes>
            <basic name="myField"/>
            <basic name="createDate" access="PROPERTY">
                <temporal>TIMESTAMP</temporal>
            </basic>
            <transient name="crtDate"/>
        </attributes>        
    </entity>
    <entity name="XMLSuperPropertyEntity"
        class="org.apache.openjpa.persistence.access.xml.XMLSuperPropertyEntity"
        access="PROPERTY">
        <inheritance/>
        <named-query name="XMLSuperPropertyEntity.query">
            <query>SELECT sfe FROM XMLSuperPropertyEntity sfe WHERE
            sfe.id = :id AND sfe.name = :name
            </query>
        </named-query>
        <named-query name="XMLSuperPropertyEntity.badQuery">
            <query>SELECT sfe FROM XMLSuperPropertyEntity sfe WHERE 
            sfe.id = :id AND sfe.name = :name AND sfe.crtDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="name" access="PROPERTY"/>
        </attributes>                
    </entity>
    <entity name="XMLFieldSub3"
        class="org.apache.openjpa.persistence.access.xml.XMLFieldSub3"
        access="FIELD">
        <inheritance/>
        <named-query name="XMLFieldSub3.query">
            <query>SELECT ps FROM XMLFieldSub3 ps WHERE 
            ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
            </query>
        </named-query>
        <named-query name="XMLFieldSub3.badQuery">
            <query>SELECT ps FROM XMLFieldSub3 ps WHERE 
            ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <basic name="crtDate">
                <temporal>TIMESTAMP</temporal>
            </basic>
        </attributes>
    </entity>
    <entity name="XMLSuperFieldEntity"
        class="org.apache.openjpa.persistence.access.xml.XMLSuperFieldEntity"
        access="FIELD">
        <inheritance/>
        <named-query name="XMLSuperFieldEntity.query">
            <query>SELECT sfe FROM XMLSuperFieldEntity sfe WHERE
            sfe.id = :id AND sfe.name = :name
            </query>
        </named-query>
        <named-query name="XMLSuperFieldEntity.badQuery">
            <query>SELECT sfe FROM XMLSuperFieldEntity sfe WHERE 
            sfe.id = :id AND sfe.name = :name AND sfe.crtDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <id name="id" access="FIELD">
                <generated-value/>
            </id>
            <basic name="name"/>
        </attributes>                
    </entity>
    <entity name="XMLPropertySub3"
        class="org.apache.openjpa.persistence.access.xml.XMLPropertySub3"
        access="PROPERTY">
        <inheritance/>
        <named-query name="XMLPropertySub3.query">
            <query>SELECT ps FROM XMLPropertySub3 ps WHERE 
            ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
            </query>
        </named-query>
        <named-query name="XMLPropertySub3.badQuery">
            <query>SELECT ps FROM XMLPropertySub3 ps WHERE 
            ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
            </query>
        </named-query>
        <attributes>
            <basic name="createDate">
                <temporal>TIMESTAMP</temporal>
            </basic>
        </attributes>
    </entity>
    <entity name="XMLPropEmbedEntity"
        class="org.apache.openjpa.persistence.access.xml.XMLPropEmbedEntity"
        access="PROPERTY">
        <named-query name="XMLPropEmbedEntity.query">
            <query>SELECT fs FROM XMLPropEmbedEntity fs WHERE 
            fs.id = :id AND fs.name = :name AND fs.embedProp.fName = :firstName 
            AND fs.embedProp.lName = :lastName
            </query>
        </named-query>
        <named-query name="XMLPropEmbedEntity.badQuery">
            <query>SELECT fs FROM XMLPropEmbedEntity fs WHERE 
            fs.id = :id AND fs.name = :name AND fs.embedProp.firstName = 
            :firstName AND fs.embedProp.lastName = :lastName
            </query>
        </named-query>
        <attributes>
            <id name="id" access="FIELD">
                <generated-value/>
            </id>
            <basic name="name"/>
            <embedded name="embedProp"/>
        </attributes>        
    </entity>
    <entity name="XMLFieldEmbedEntity"
        class="org.apache.openjpa.persistence.access.xml.XMLFieldEmbedEntity"
        access="FIELD">
        <named-query name="XMLFieldEmbedEntity.query">
            <query>SELECT fs FROM XMLFieldEmbedEntity fs WHERE 
            fs.id = :id AND fs.name = :name AND fs.epa.firstName = :firstName  
            AND fs.epa.lastName = :lastName
            </query>
        </named-query>
        <named-query name="XMLFieldEmbedEntity.badQuery">
            <query>SELECT fs FROM XMLFieldEmbedEntity fs WHERE 
            fs.id = :id AND fs.name = :name AND fs.epa.fName = :firstName 
            AND fs.epa.lName = :lastName
            </query>
        </named-query>
        <attributes>
            <id name="id">
                <generated-value/>
            </id>
            <basic name="name"/>
            <embedded name="epa" access="FIELD"/>
        </attributes>        
    </entity>
    <entity name="XMLPropMixedEntity"
        class="org.apache.openjpa.persistence.access.xml.XMLPropMixedEntity"
        access="PROPERTY">
        <named-query name="XMLPropMixedEntity.query">
            <query>SELECT fs FROM XMLPropMixedEntity fs WHERE 
            fs.idval = :id AND fs.name = :name AND 
            fs.ema.firstName = :firstName
            AND fs.ema.lastName = :lastName AND 
            fs.ema.mName = :middleName
           </query>
        </named-query>
        <named-query name="XMLPropMixedEntity.badQuery">
            <query>SELECT fs FROM XMLPropMixedEntity fs WHERE 
            fs.idval = :id AND fs.name = :name AND 
            fs.ema.firstName = :firstName AND 
            fs.ema.lastName = :lastName AND 
            fs.ema.middleName = :middleName
            </query>
        </named-query>
        <attributes>
            <id name="idval" access="FIELD">
                <generated-value/>
            </id>
            <basic name="name"/>
            <embedded name="ema" access="FIELD"/>
            <transient name="id"/>
            <transient name="embedProp"/>
        </attributes>
    </entity>   
    
    <embeddable
        class="org.apache.openjpa.persistence.access.xml.XMLEmbedFieldAccess"
        access="FIELD">
        <attributes>
            <basic name="fName"/>
            <basic name="lName"/>
        </attributes>
    </embeddable>    
    <embeddable
        class="org.apache.openjpa.persistence.access.xml.XMLEmbedPropAccess"
        access="PROPERTY">
        <attributes>
            <basic name="firstName"/>
            <basic name="lastName"/>
        </attributes>
    </embeddable>
    <embeddable
        class="org.apache.openjpa.persistence.access.xml.XMLEmbedMixedAccess"
        access="PROPERTY">
        <attributes>
            <basic name="mName" access="FIELD"/>
            <basic name="firstName"/>
            <basic name="lastName"/>
            <transient name="middleName"/>
        </attributes>
    </embeddable>
 </entity-mappings>