<?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
                    http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" 
version="1.0">

<persistence-unit-metadata>
   <persistence-unit-defaults>
       <entity-listeners>
            <entity-listener class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.DefaultCallbackListener">
                 <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" />
            </entity-listener>
        </entity-listeners> 
   </persistence-unit-defaults>
</persistence-unit-metadata>

<!-- <entity class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.Schedule" metadata-complete="true">
		<description>
			Schedule class represents the superclass of this app...
		</description>
		<inheritance strategy="TABLE_PER_CLASS" />

	     <entity-listeners>
			<entity-listener class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.DateValidator">
				<pre-persist method-name="prePersist" />
				<post-persist method-name="postPersist" />
			</entity-listener>

			<entity-listener class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.StringValidator">
				<pre-persist method-name="prePersist" />
				<post-persist method-name="postPersist" />
			</entity-listener>
		</entity-listeners> 

		<attributes>
			<id name="id">
				<generated-value strategy="AUTO" />
			</id>
			<basic name="dob">
				<temporal>DATE</temporal>
			</basic>
			<basic name="startDate">
				<temporal>TIME</temporal>
			</basic>
			<basic name="endDate">
				<temporal>TIMESTAMP</temporal>
			</basic>
			<basic name="name">
			</basic>
		</attributes>
	</entity>

	<entity class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.FlightSchedule" metadata-complete="true">
		<description>
			FlightSchedule, subclass of schedule specifies the real life flight schedule 
		</description>

		<table name="Flight_Sched">
			<unique-constraint>
				<column-name>planeName</column-name>
			</unique-constraint>
		</table>

		<attributes>
			<id name="FlightNum">
				<generated-value strategy="AUTO" />
			</id>
			<basic name="planeName">
				<column name="flight_name"/>
			</basic>
		</attributes>
	</entity>

	 <entity class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.Employee" metadata-complete="true">
		<inheritance strategy="JOINED" />

		<entity-listeners>
			<entity-listener class="annotations.common.apps.NameValidator">
				<pre-persist method-name="validateName" />
				<pre-remove method-name="validateNothing1" />
				<post-remove method-name="validateNothing" />
				<post-update method-name="testpost" />
			</entity-listener>

			<entity-listener class="annotations.common.apps.LongNameValidator">
				<pre-persist method-name="validateName" />
				<post-update method-name="testpost" />
			</entity-listener>
		</entity-listeners> 

		<attributes>
			<id name="id">
			</id>
			<basic name="name">
			</basic>
			<transient name="syncTime" />
		</attributes>
	</entity>

	<entity class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.ContractEmployee" metadata-complete="true">
	</entity>  

	<entity class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.TxRollbackEntity" metadata-complete="true">
	</entity> -->


  <!-- <entity class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.LifeCycleDDEntity">
    <exclude-default-listeners />
    <entity-listeners>
			<entity-listener class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.EntityDDListener">
				<post-remove method-name="verifyPostRemove" />
				<post-update method-name="verifyPostUpdate" />
			</entity-listener>

			<entity-listener class="org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.EntityDDListener2">
				<pre-update method-name="verifyPreUpdate" />
				<post-load method-name="verifyPostLoad" /> 
			</entity-listener>
		</entity-listeners>

        <pre-persist method-name="verifyPrePersist" />
        <post-persist method-name="verifyPostPersist" />
        <pre-remove method-name="verifyPreRemove" />

		<attributes>
			<id name="id">
				<generated-value strategy="AUTO" />
			</id>
			<basic name="name">
			</basic>
			<basic name="surname">
			</basic>
		</attributes>
	</entity> -->
</entity-mappings>
