2006-11-12 07:11:37 -05:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2006-10-30 21:30:39 -05:00
|
|
|
<!--
|
|
|
|
Copyright 2006 The Apache Software Foundation.
|
|
|
|
|
|
|
|
Licensed 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.
|
|
|
|
-->
|
2006-10-28 00:06:11 -04:00
|
|
|
<project default="usagewarning">
|
|
|
|
|
|
|
|
<property name="parent" value="${basedir}/.."/>
|
|
|
|
<property name="root" value="${parent}/.."/>
|
|
|
|
|
|
|
|
<target name="usagewarning">
|
|
|
|
<fail>
|
|
|
|
Please traverse to a sub-directory and run "ant" from there.
|
|
|
|
</fail>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<path id="classpath"
|
|
|
|
description="The classpath to use for compiling and running">
|
|
|
|
<pathelement path="${parent}"/>
|
|
|
|
<fileset dir="${root}">
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="javaagent">
|
|
|
|
<fileset dir="${root}">
|
|
|
|
<include name="openjpa-*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
<pathconvert property="javaagent" refid="javaagent"/>
|
|
|
|
|
|
|
|
<target name="clean"
|
|
|
|
description="Clean up compiled files and generated database files">
|
|
|
|
<delete includeemptydirs="true">
|
|
|
|
<fileset dir="${basedir}">
|
|
|
|
<include name="*.class"/>
|
|
|
|
<include name="*.log"/>
|
|
|
|
<include name="${example}-database/**/*"/>
|
|
|
|
<include name="${example}-database"/>
|
|
|
|
</fileset>
|
|
|
|
</delete>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" description="Compile the example java files">
|
|
|
|
<javac srcdir="${parent}" classpathref="classpath"
|
|
|
|
includes="${example}/**.java"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="run" depends="compile"
|
|
|
|
description="Run the example Main program">
|
|
|
|
|
2006-11-12 07:05:40 -05:00
|
|
|
<java classname="${example}.Main" classpathref="classpath" fork="yes"
|
|
|
|
failonerror="yes">
|
2006-10-28 00:06:11 -04:00
|
|
|
<!--
|
|
|
|
Specifying the openjpa jar as the javaagent argument is
|
|
|
|
necessary in order for automatic class-enhancement to work.
|
|
|
|
-->
|
|
|
|
<jvmarg value="-javaagent:${javaagent}"/>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Specify the system properties to use when configuring
|
|
|
|
OpenJPA. Note that these will only be used becuase in the
|
|
|
|
examples, the call to "Persistence.createEntityManagerFactory"
|
|
|
|
is passed "System.getProperties()".
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
By default, use the stand-alone Derby database (provided).
|
|
|
|
This can easily be changes to use your own database's driver,
|
|
|
|
provided you ensure it is accessible in the classpath.
|
|
|
|
-->
|
|
|
|
<sysproperty key="openjpa.ConnectionDriverName"
|
|
|
|
value="org.apache.derby.jdbc.EmbeddedDriver"/>
|
|
|
|
<sysproperty key="openjpa.ConnectionURL"
|
|
|
|
value="jdbc:derby:${example}-database;create=true"/>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Tell OpenJPA to automatically create tables in the database
|
|
|
|
for entities. Note that this should be disabled when
|
|
|
|
running against a production database, since you probably
|
|
|
|
don't want to be altering the schema at runtime.
|
|
|
|
-->
|
|
|
|
<sysproperty key="openjpa.jdbc.SynchronizeMappings"
|
|
|
|
value="buildSchema"/>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Output all the SQL for educational purposes, but set the
|
|
|
|
general logging level to only show warnings.
|
|
|
|
-->
|
|
|
|
<sysproperty key="openjpa.Log"
|
|
|
|
value="DefaultLevel=WARN,SQL=TRACE"/>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
</project>
|
|
|
|
|