Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 92812 Details for
Bug 218628
Add performance tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
2008-03-18 - jpa-perf-tests-scripts.patch (text/plain), 205.39 KB, created by
James Sutherland
on 2008-03-18 11:52:34 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
James Sutherland
Created:
2008-03-18 11:52:34 EDT
Size:
205.39 KB
patch
obsolete
>Index: foundation/eclipselink.core.test/build.xml >=================================================================== >--- foundation/eclipselink.core.test/build.xml (revision 10919) >+++ foundation/eclipselink.core.test/build.xml (working copy) >@@ -133,6 +133,13 @@ > </antcall> > </target> > >+ <!-- Runs concurrency tests. --> >+ <target name="test.concurrency"> >+ <antcall target="run.test.prompt" inheritRefs="true"> >+ <param name="TEST_CLASS" value="org.eclipse.persistence.testing.tests.performance.ConcurrencyComparisonTestModel"/> >+ </antcall> >+ </target> >+ > <!-- Launches the testing browser --> > <target name="test.browser"> > <echo>Running test browser with ${test.properties}</echo> >@@ -191,8 +198,8 @@ > dir="${eclipselink.core.test}/${run.dir}"> > <jvmarg value="-Declipselink.logging.level=${logging.level}"/> > <jvmarg value="-Dtest.properties=${test.properties.run}"/> >- <jvmarg value="-Djava.security.manager"/> >- <jvmarg value="-Djava.security.policy=./java.policy.allpermissions"/> >+ <jvmarg value="${test.security-manager}"/> >+ <jvmarg value="${test.security-manager.policy}"/> > <arg value="pfile=${test.properties.run}" /> > <arg value="testmodel=${TEST_CLASS}" /> > <arg value="regressionlog=../${report.dir}/test.log" /> >Index: foundation/eclipselink.core.test/test.properties >=================================================================== >--- foundation/eclipselink.core.test/test.properties (revision 10919) >+++ foundation/eclipselink.core.test/test.properties (working copy) >@@ -36,8 +36,15 @@ > # This is used to translate the 9.0.4 format sessions.xml resources. > logging.boolvalue=false > >+# Security manager options, switch from ignore to use a security manager >+test.security-manager=-Dignore >+# test.security-manager=-Djava.security.manager >+test.security-manager.policy=-Dignore >+# test.security-manager.policy=-Djava.security.policy=./java.policy.allpermissions >+ > # Test class to be run. > test.class=org.eclipse.persistence.testing.tests.TestRunModel >+# test.class=org.eclipse.persistence.testing.tests.feature.FeatureTestModel > # test.class=org.eclipse.persistence.testing.tests.simultaneous.SimultaneousTestsModel > # test.class=org.eclipse.persistence.testing.tests.SRGTestModel > >Index: foundation/eclipselink.core.test/Testing Browser.launch >=================================================================== >--- foundation/eclipselink.core.test/Testing Browser.launch (revision 10919) >+++ foundation/eclipselink.core.test/Testing Browser.launch (working copy) >@@ -27,11 +27,6 @@ > <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/eclipselink.core.lib/persistence.jar" path="3" sourceAttachmentPath="/eclipselink.core.lib/persistence-src.zip" sourceRootPath="" type="2"/> "/> > <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="JDBC_LIB" path="3" type="3"/> "/> > <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="TOOLS_LIB" path="3" type="3"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/postgresql_jdbc3_82.jar" path="3" type="2"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/db2java_9.zip" path="3" type="2"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/jconn3.jar" path="3" type="2"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/mysql-connector-java-5.0.7-bin.jar" path="3" type="2"/> "/> >- > </listAttribute> > <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> > <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.persistence.testing.framework.ui.TestingBrowserFrame"/> >Index: jpa/eclipselink.jpa.test/build.properties >=================================================================== >--- jpa/eclipselink.jpa.test/build.properties (revision 10919) >+++ jpa/eclipselink.jpa.test/build.properties (working copy) >@@ -14,8 +14,29 @@ > eclipselink.jpa=../eclipselink.jpa > eclipselink.core.test=../eclipselink.core.test > eclipselink.core.test.trunk=../../foundation/eclipselink.core.test >-eclipselink.jpa.test=. > >+eclipselink.extension.oracle=../eclipselink.extension.oracle >+eclipselink.extension.oracle.trunk=../../eclipselink.extension.oracle >+eclipselink.extension.oracle.test=../eclipselink.extension.oracle.test >+eclipselink.extension.oracle.test.trunk=../../eclipselink.extension.oracle.test >+ >+eclipselink-annotation-model=eclipselink-annotation-model >+eclipselink-ddl-generation-model=eclipselink-ddl-generation-model >+eclipselink-xml-only-model=eclipselink-xml-only-model >+eclipselink-xml-merge-model=eclipselink-xml-merge-model >+eclipselink-validation-failed-model=eclipselink-validation-failed-model >+eclipselink-advanced-field-access-model=eclipselink-advanced-field-access-model >+eclipselink-advanced-properties=eclipselink-advanced-properties >+eclipselink-xml-extended-model=eclipselink-xml-extended-model >+jpa-performance=jpa-performance >+ >+eclipselink-struct-converter-model=eclipselink-struct-converter-model >+oracle.spatial.lib=sdoapi.jar >+ >+eclipselink.tests.jar=eclipselink-tests.jar >+ > test.properties=./test.properties > src.dir=src > classes.dir=classes >+build.dir=build >+resource.dir=resource >Index: jpa/eclipselink.jpa.test/build.xml >=================================================================== >--- jpa/eclipselink.jpa.test/build.xml (revision 10919) >+++ jpa/eclipselink.jpa.test/build.xml (working copy) >@@ -35,7 +35,10 @@ > <property name="eclipselink.core.dir" value="${eclipselink.jpa.test}/${eclipselink.core.trunk}"/> > <property name="eclipselink.core.test.dir" value="${eclipselink.jpa.test}/${eclipselink.core.test.trunk}"/> > <property name="eclipselink.core.lib.dir" value="${eclipselink.jpa.test}/${eclipselink.core.lib.trunk}"/> >+ <property name="eclipselink.extension.oracle.dir" value="${eclipselink.jpa.test}/${eclipselink.extension.oracle.trunk}"/> >+ <property name="eclipselink.extension.oracle.test.dir" value="${eclipselink.jpa.test}/${eclipselink.extension.oracle.test.trunk}"/> > <antcall target="config.compile-path" inheritRefs="true"/> >+ <antcall target="config.run-path" inheritRefs="true"/> > </target> > > <!-- Configures paths for Eclipse project checkout. --> >@@ -43,7 +46,10 @@ > <property name="eclipselink.core.dir" value="${eclipselink.core}"/> > <property name="eclipselink.core.test.dir" value="${eclipselink.core.test}"/> > <property name="eclipselink.core.lib.dir" value="${eclipselink.core.lib}"/> >+ <property name="eclipselink.extension.oracle.dir" value="${eclipselink.extension.oracle}"/> >+ <property name="eclipselink.extension.oracle.test.dir" value="${eclipselink.extension.oracle.test}"/> > <antcall target="config.compile-path" inheritRefs="true"/> >+ <antcall target="config.run-path" inheritRefs="true"/> > </target> > > <target name="config.compile-path"> >@@ -70,8 +76,8 @@ > <mkdir dir="${eclipselink.jpa.test}/${classes.dir}"/> > <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-annotation-model}"/> > <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-xml-only-model}"/> >- <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-xml-extended-model}"/> >- <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-xml-merge-model}"/> >+ <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-xml-extended-model}"/> >+ <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-xml-merge-model}"/> > <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-validation-failed-model}"/> > <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-advanced-field-access-model}"/> > <mkdir dir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-advanced-properties}"/> >@@ -79,7 +85,7 @@ > </target> > > <!-- Compiles all tests. --> >- <target name="compile" depends="init, config.trunk, config.flat" description="compile EclipseLink tesing"> >+ <target name="compile" depends="init, config.trunk, config.flat" description="compile EclipseLink testing"> > <javac srcdir="${eclipselink.jpa.test}/${src.dir}" > destdir="${eclipselink.jpa.test}/${classes.dir}" > includes="org/eclipse/persistence/testing/**" >@@ -153,7 +159,7 @@ > </fileset> > </jar> > </target> >- >+ > <target name="package.xml-extended" depends=""> > <copy todir="${eclipselink.jpa.test}/${build.dir}/${eclipselink-xml-extended-model}/META-INF"> > <fileset dir="${eclipselink.jpa.test}/resource/eclipselinkorm/${eclipselink-xml-extended-model}" includes="*.xml"/> >@@ -233,8 +239,8 @@ > <fileset dir="${eclipselink.jpa.test}/resource/${jpa-performance}/META-INF" includes="*.xml"/> > </copy> > <copy todir="${eclipselink.jpa.test}/${build.dir}/${jpa-performance}"> >- <fileset dir="${eclipselink.core.test.dir}/${classes.dir}" >- includes="org/eclipse/persistence/testing/models/performance/**"/> >+ <fileset dir="${eclipselink.jpa.test}/${classes.dir}" >+ includes="org/eclipse/persistence/testing/models/jpa/performance/**"/> > </copy> > <jar jarfile="${eclipselink.jpa.test}/${jpa-performance}.jar"> > <fileset dir="${eclipselink.jpa.test}/${build.dir}/${jpa-performance}"> >@@ -250,7 +256,7 @@ > <fileset file="${eclipselink.jpa.test}/${eclipselink-annotation-model}.jar"/> > <fileset file="${eclipselink.jpa.test}/${eclipselink-ddl-generation-model}.jar"/> > <fileset file="${eclipselink.jpa.test}/${eclipselink-xml-only-model}.jar"/> >- <fileset file="${eclipselink.jpa.test}/${eclipselink-xml-extended-model}.jar"/> >+ <fileset file="${eclipselink.jpa.test}/${eclipselink-xml-extended-model}.jar"/> > <fileset file="${eclipselink.jpa.test}/${eclipselink-xml-merge-model}.jar"/> > <fileset file="${eclipselink.jpa.test}/${eclipselink-validation-failed-model}.jar"/> > <fileset file="${eclipselink.jpa.test}/${eclipselink-advanced-field-access-model}.jar"/> >@@ -262,77 +268,163 @@ > <!-- Testing --> > > <!-- Classpath used for running tests. --> >- <path id="run.classpath"> >- <pathelement path="${jdbc.driver.jar}"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink.tests.jar}"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-annotation-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-ddl-generation-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-xml-only-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-xml-extended-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-xml-merge-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-validation-failed-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-advanced-field-access-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink-advanced-properties}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/${jpa-performance}.jar"/> >- <pathelement path="${eclipselink.extension.oracle.test}/${eclipselink-struct-converter-model}.jar"/> >- <pathelement path="${eclipselink.extension.oracle.test}/${eclipselink-struct-converter-model}-tests.jar"/> >- <pathelement path="${oracle.extensions.depend.dir}/${oracle.spatial.lib}"/> >- </path> >+ <target name="config.run-path"> >+ <path id="run.classpath"> >+ <pathelement path="${eclipselink.jpa.test}/${classes.dir}"/> >+ <path refid="compile.path"/> >+ <!-- Currently the Oracle extensions are included to allow running Oracle extensions tests from here. --> >+ <pathelement path="${eclipselink.extension.oracle.dir}/${classes.dir}"/> >+ <pathelement path="${eclipselink.extension.oracle.dir}/eclipselink-extension-oracle.jar"/> >+ <pathelement path="${jdbc.driver.jar}"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink.tests.jar}"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-annotation-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-ddl-generation-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-xml-only-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-xml-extended-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-xml-merge-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-validation-failed-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-advanced-field-access-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink-advanced-properties}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/${jpa-performance}.jar"/> >+ <pathelement path="${eclipselink.extension.oracle.test.dir}/${eclipselink-struct-converter-model}.jar"/> >+ <pathelement path="${eclipselink.extension.oracle.test.dir}/${eclipselink-struct-converter-model}-tests.jar"/> >+ <pathelement path="${oracle.extensions.depend.dir}/${oracle.spatial.lib}"/> >+ </path> >+ </target> > > <!-- Default test target, run the LRG --> > <target name="test"> >- <antcall target="test.lrg" inheritRefs="true"/> >+ <antcall target="run.test" inheritRefs="true"> >+ <param name="TEST_CLASS" value="${test.class}"/> >+ <param name="TEST_AGENT" value="${test.agent}"/> >+ <param name="TEST_WEAVING" value="${test.weaving}"/> >+ <param name="RUN_PATH" value="run.classpath"/> >+ </antcall> > </target> > > <!-- Runs LRG (FullRegressionTestSuite) with agent. --> > <target name="test.lrg"> >- <property name="test.agent" value="-javaagent:${eclipselink.jar.run}"/> >- <property name="test.weaving" value="-Darg2=false"/> >- <antcall target="run.test" inheritRefs="true"/> >+ <antcall target="run.test" inheritRefs="true"> >+ <param name="TEST_CLASS" value="org.eclipse.persistence.testing.tests.jpa.FullRegressionTestSuite"/> >+ <param name="TEST_AGENT" value="${test.agent}"/> >+ <param name="TEST_WEAVING" value="${test.weaving}"/> >+ <param name="RUN_PATH" value="run.classpath"/> >+ </antcall> > </target> > >+ <!-- Runs SRG (EntityManagerJUnitTestSuite) with agent. --> >+ <target name="test.srg"> >+ <antcall target="run.test" inheritRefs="true"> >+ <param name="TEST_CLASS" value="org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite"/> >+ <param name="TEST_AGENT" value="${test.agent}"/> >+ <param name="TEST_WEAVING" value="${test.weaving}"/> >+ <param name="RUN_PATH" value="run.classpath"/> >+ </antcall> >+ </target> >+ > <!-- Runs FullRegressionTestSuite with no agent. TEST_NO_WEAVING property informs tests that no weaving was done. --> > <target name="test.no-weave"> >- <property name="test.agent" value="-Darg1=false"/> >- <property name="test.weaving" value="-DTEST_NO_WEAVING=true"/> >- <antcall target="run.test" inheritRefs="true"/> >+ <antcall target="run.test" inheritRefs="true"> >+ <param name="TEST_CLASS" value="${test.class}"/> >+ <param name="TEST_AGENT" value="-Dignore"/> >+ <param name="TEST_WEAVING" value="-DTEST_NO_WEAVING=true"/> >+ <param name="RUN_PATH" value="run.classpath"/> >+ </antcall> > </target> > > <!-- Runs FullRegressionTestSuite with static weaving. --> > <target name="test.static-weave" depends="config.trunk, config.flat, run-weaver"> >- <path id="run.classpath"> >- <pathelement path="${jdbc.driver.jar}"/> >- <pathelement path="${eclipselink.jpa.test}/${eclipselink.tests.jar}"/> >+ <path id="run.classpath.static"> > <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-annotation-model}.jar"/> > <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-ddl-generation-model}.jar"/> > <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-xml-only-model}.jar"/> >- <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-xml-extended-model}.jar"/> >+ <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-xml-extended-model}.jar"/> > <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-xml-merge-model}.jar"/> > <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-validation-failed-model}.jar"/> > <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-advanced-field-access-model}.jar"/> > <pathelement path="${eclipselink.jpa.test}/woven-${eclipselink-advanced-properties}.jar"/> > <pathelement path="${eclipselink.jpa.test}/woven-${jpa-performance}.jar"/> >+ <pathelement path="${jdbc.driver.jar}"/> >+ <pathelement path="${eclipselink.jpa.test}/${classes.dir}"/> >+ <pathelement path="${eclipselink.jpa.test}/${eclipselink.tests.jar}"/> >+ <path refid="compile.path"/> > </path> >- <property name="test.agent" value="-Darg1=false"/> >- <property name="test.weaving" value="-Darg2=false"/> >- <antcall target="run.test" inheritRefs="true"/> >+ <antcall target="run.test" inheritRefs="true"> >+ <param name="TEST_CLASS" value="${test.class}"/> >+ <param name="TEST_AGENT" value="-Dignore"/> >+ <param name="TEST_WEAVING" value="-Dignore"/> >+ <param name="RUN_PATH" value="run.classpath.static"/> >+ </antcall> > </target> > >+ <!-- Prompt runner test target, runs test.class from test.properties (default is LRG). --> >+ <target name="test.prompt"> >+ <antcall target="run.test.prompt" inheritRefs="true"> >+ <param name="TEST_CLASS" value="${test.class}"/> >+ <param name="RUN_PATH" value="run.classpath"/> >+ <param name="TEST_AGENT" value="${test.agent}"/> >+ <param name="TEST_WEAVING" value="${test.weaving}"/> >+ </antcall> >+ </target> >+ >+ <!-- Runs performance tests. --> >+ <target name="test.performance"> >+ <antcall target="run.test.prompt" inheritRefs="true"> >+ <param name="TEST_CLASS" value="org.eclipse.persistence.testing.tests.jpa.performance.JPAPerformanceRegressionModel"/> >+ <param name="RUN_PATH" value="run.classpath"/> >+ <param name="TEST_AGENT" value="${test.agent}"/> >+ <param name="TEST_WEAVING" value="${test.weaving}"/> >+ </antcall> >+ </target> >+ >+ <!-- Runs performance tests comparing with TopLink. --> >+ <target name="test.performance.toplink"> >+ <path id="run.classpath.toplink"> >+ <pathelement path="${toplink.jar}"/> >+ <path refid="run.classpath"/> >+ </path> >+ <antcall target="run.test.prompt" inheritRefs="true"> >+ <param name="TEST_CLASS" value="org.eclipse.persistence.testing.tests.jpa.performance.TopLinkJPAPerformanceRegressionModel"/> >+ <param name="RUN_PATH" value="run.classpath.toplink"/> >+ <param name="TEST_AGENT" value="-javaagent:../${toplink.jar}"/> >+ <param name="TEST_WEAVING" value="-Dignore"/> >+ </antcall> >+ </target> >+ >+ <!-- Launches the testing browser --> >+ <target name="test.browser" depends="config.trunk, config.flat"> >+ <echo>Running test browser with ${test.properties}</echo> >+ <mkdir dir="${eclipselink.jpa.test}/${run.dir}"/> >+ <mkdir dir="${eclipselink.jpa.test}/${report.dir}"/> >+ <java classname="org.eclipse.persistence.testing.framework.ui.TestingBrowserFrame" >+ fork="true" >+ maxmemory="512m" >+ failonerror="true" >+ dir="${eclipselink.jpa.test}/${run.dir}"> >+ <jvmarg value="${test.agent}"/> >+ <jvmarg value="${test.weaving}"/> >+ <jvmarg value="-Declipselink.logging.level=${logging.level}"/> >+ <jvmarg value="-Dtest.properties=${test.properties.run}"/> >+ <classpath> >+ <path refid="run.classpath"/> >+ </classpath> >+ </java> >+ </target> >+ > <!-- Generic target for running tests. --> > <target name="run.test" depends="config.trunk, config.flat"> > <echo>Running test with ${test.properties} on ${db.url}</echo> > <mkdir dir="${eclipselink.jpa.test}/${report.dir}"/> > <junit printsummary="yes" haltonfailure="yes" failureproperty="junit.failed" fork="yes" showoutput="true" maxmemory="512m" dir="${eclipselink.jpa.test}/${run.dir}"> >- <jvmarg value="${test.agent}"/> >- <jvmarg value="${test.weaving}"/> >+ <jvmarg value="${TEST_AGENT}"/> >+ <jvmarg value="${TEST_WEAVING}"/> > <jvmarg value="-Declipselink.logging.level=${logging.level}"/> > <jvmarg value="-Dtest.properties=${test.properties.run}"/> > <classpath> >- <path refid="compile.path"/> >- <path refid="run.classpath"/> >+ <path refid="${RUN_PATH}"/> > </classpath> > <formatter type="xml"/> >- <test name="${test.class}" haltonfailure="no" outfile="${eclipselink.jpa.test}/${report.dir}/test-results"> >+ <test name="${TEST_CLASS}" haltonfailure="no" outfile="${eclipselink.jpa.test}/${report.dir}/test-results"> > </test> > </junit> > <junitreport todir="${eclipselink.jpa.test}/${report.dir}"> >@@ -344,6 +436,30 @@ > <fail message="Some of the junit tests failed. See the ${report.dir}/junit-noframes.html file for details." if="junit.failed"/> > </target> > >+ <!-- Runs the test using the PromptTestRunner --> >+ <target name="run.test.prompt" depends="config.trunk, config.flat"> >+ <echo>Running test with ${test.properties} on ${db.url}</echo> >+ <mkdir dir="${eclipselink.jpa.test}/${run.dir}"/> >+ <mkdir dir="${eclipselink.jpa.test}/${report.dir}"/> >+ <java classname="org.eclipse.persistence.testing.framework.PromptTestRunner" >+ fork="true" >+ maxmemory="512m" >+ failonerror="true" >+ dir="${eclipselink.jpa.test}/${run.dir}"> >+ <jvmarg value="${TEST_AGENT}"/> >+ <jvmarg value="${TEST_WEAVING}"/> >+ <jvmarg value="-Declipselink.logging.level=${logging.level}"/> >+ <jvmarg value="-Dtest.properties=${test.properties.run}"/> >+ <arg value="pfile=${test.properties.run}"/> >+ <arg value="testmodel=${TEST_CLASS}"/> >+ <arg value="regressionlog=../${report.dir}/test.log"/> >+ <arg value="saveresults=true"/> >+ <classpath> >+ <path refid="${RUN_PATH}"/> >+ </classpath> >+ </java> >+ </target> >+ > <!-- Runs EclipseLink static weaving ant task on test jars. --> > <target name="run-weaver"> > <!-- define weaving ant task--> >@@ -356,63 +472,54 @@ > <weave source= "${eclipselink.jpa.test}/${eclipselink-annotation-model}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-annotation-model}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> > <weave source= "${eclipselink.jpa.test}/${eclipselink-ddl-generation-model}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-ddl-generation-model}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> >- <weave source= "${eclipselink.jpa.test}/${eclipselink-xml-only-model}.jar" >+ <!--weave source= "${eclipselink.jpa.test}/${eclipselink-xml-only-model}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-xml-only-model}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> > <weave source= "${eclipselink.jpa.test}/${eclipselink-xml-extended-model}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-xml-extended-model}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> > <weave source= "${eclipselink.jpa.test}/${eclipselink-xml-merge-model}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-xml-merge-model}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> >- </weave> >+ </weave--> > <weave source= "${eclipselink.jpa.test}/${eclipselink-validation-failed-model}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-validation-failed-model}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> > <weave source= "${eclipselink.jpa.test}/${eclipselink-advanced-field-access-model}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-advanced-field-access-model}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> > <weave source= "${eclipselink.jpa.test}/${eclipselink-advanced-properties}.jar" > target = "${eclipselink.jpa.test}/woven-${eclipselink-advanced-properties}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> > <weave source= "${eclipselink.jpa.test}/${jpa-performance}.jar" > target = "${eclipselink.jpa.test}/woven-${jpa-performance}.jar"> > <classpath> >- <path refid="compile.path"/> > <path refid="run.classpath"/> > </classpath> > </weave> >Index: jpa/eclipselink.jpa.test/local.build.properties >=================================================================== >--- jpa/eclipselink.jpa.test/local.build.properties (revision 10919) >+++ jpa/eclipselink.jpa.test/local.build.properties (working copy) >@@ -1,18 +0,0 @@ >-# do not edit the properties below >-eclipselink-annotation-model=eclipselink-annotation-model >-eclipselink-ddl-generation-model=eclipselink-ddl-generation-model >-eclipselink-xml-only-model=eclipselink-xml-only-model >-eclipselink-xml-merge-model=eclipselink-xml-merge-model >-eclipselink-validation-failed-model=eclipselink-validation-failed-model >-eclipselink-advanced-field-access-model=eclipselink-advanced-field-access-model >-eclipselink-advanced-properties=eclipselink-advanced-properties >-eclipselink-xml-extended-model=eclipselink-xml-extended-model >-jpa-performance=jpa-performance >- >-eclipselink.extension.oracle.test=../eclipselink.extension.oracle.test >-eclipselink-struct-converter-model=eclipselink-struct-converter-model >-oracle.spatial.lib=sdoapi.jar >- >-eclipselink.tests.jar=eclipselink-tests.jar >- >-build.dir=build >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/resource/jpa-performance/META-INF/jpa-orm.xml >=================================================================== >--- jpa/eclipselink.jpa.test/resource/jpa-performance/META-INF/jpa-orm.xml (revision 10919) >+++ jpa/eclipselink.jpa.test/resource/jpa-performance/META-INF/jpa-orm.xml (working copy) >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <entity-mappings version="1.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_1_0.xsd"> > <description>JPA Performance Test ORM</description> >- <entity name="Employee" class="org.eclipse.persistence.testing.models.performance.Employee" access="PROPERTY"> >+ <entity name="Employee" class="org.eclipse.persistence.testing.models.jpa.performance.Employee" access="PROPERTY"> > <table name="EMPLOYEE"/> > <sequence-generator name="EMP_SEQ" sequence-name="EMP_SEQ" allocation-size="48"/> > <attributes> >@@ -24,29 +24,29 @@ > <version name="version"> > <column name="VERSION"/> > </version> >- <many-to-one name="manager" target-entity="org.eclipse.persistence.testing.models.performance.Employee" fetch="LAZY"> >+ <many-to-one name="manager" target-entity="org.eclipse.persistence.testing.models.jpa.performance.Employee" fetch="LAZY"> > <join-column name="MANAGER_ID" referenced-column-name="EMP_ID"/> > <cascade> > <cascade-persist/> > </cascade> > </many-to-one> >- <one-to-many name="phoneNumbers" target-entity="org.eclipse.persistence.testing.models.performance.PhoneNumber" mapped-by="owner"> >+ <one-to-many name="phoneNumbers" target-entity="org.eclipse.persistence.testing.models.jpa.performance.PhoneNumber" mapped-by="owner"> > <cascade> > <cascade-all/> > </cascade> > </one-to-many> >- <one-to-many name="managedEmployees" target-entity="org.eclipse.persistence.testing.models.performance.Employee" mapped-by="manager"> >+ <one-to-many name="managedEmployees" target-entity="org.eclipse.persistence.testing.models.jpa.performance.Employee" mapped-by="manager"> > <cascade> > <cascade-persist/> > </cascade> > </one-to-many> >- <one-to-one name="address" target-entity="org.eclipse.persistence.testing.models.performance.Address" fetch="LAZY"> >+ <one-to-one name="address" target-entity="org.eclipse.persistence.testing.models.jpa.performance.Address" fetch="LAZY"> > <join-column name="ADDR_ID"/> > <cascade> > <cascade-all/> > </cascade> > </one-to-one> >- <many-to-many name="projects" target-entity="org.eclipse.persistence.testing.models.performance.Project"> >+ <many-to-many name="projects" target-entity="org.eclipse.persistence.testing.models.jpa.performance.Project"> > <join-table name="PROJ_EMP"> > <join-column name="EMP_ID" referenced-column-name="EMP_ID"/> > <inverse-join-column name="PROJ_ID" referenced-column-name="PROJ_ID"/> >@@ -58,11 +58,14 @@ > <embedded name="period"/> > </attributes> > </entity> >- <entity name="Address" class="org.eclipse.persistence.testing.models.performance.Address" access="PROPERTY"> >+ <entity name="Address" class="org.eclipse.persistence.testing.models.jpa.performance.Address" access="PROPERTY"> > <table name="ADDRESS"/> > <sequence-generator name="ADDRESS_SEQ" sequence-name="ADDRESS_SEQ" allocation-size="48"/> > <named-query name="findAddressByCity"> > <query>Select a from Address a where a.city = :city</query> >+ </named-query> >+ <named-query name="findAddressByStreet"> >+ <query>Select a from Address a where a.street = :street</query> > </named-query> > <attributes> > <id name="id"> >@@ -86,7 +89,7 @@ > </basic> > </attributes> > </entity> >- <entity name="PhoneNumber" class="org.eclipse.persistence.testing.models.performance.PhoneNumber" access="PROPERTY"> >+ <entity name="PhoneNumber" class="org.eclipse.persistence.testing.models.jpa.performance.PhoneNumber" access="PROPERTY"> > <table name="PHONE"/> > <sequence-generator name="PHONE_SEQ" sequence-name="PHONE_SEQ" allocation-size="48"/> > <attributes> >@@ -103,12 +106,12 @@ > <basic name="areaCode"> > <column name="AREA_CODE"/> > </basic> >- <many-to-one name="owner" target-entity="org.eclipse.persistence.testing.models.performance.Employee" fetch="LAZY"> >+ <many-to-one name="owner" target-entity="org.eclipse.persistence.testing.models.jpa.performance.Employee" fetch="LAZY"> > <join-column name="EMP_ID" referenced-column-name="EMP_ID"/> > </many-to-one> > </attributes> > </entity> >- <entity name="LargeProject" class="org.eclipse.persistence.testing.models.performance.LargeProject" access="PROPERTY"> >+ <entity name="LargeProject" class="org.eclipse.persistence.testing.models.jpa.performance.LargeProject" access="PROPERTY"> > <table name="LPROJECT"/> > <discriminator-value>L</discriminator-value> > <attributes> >@@ -120,11 +123,11 @@ > </basic> > </attributes> > </entity> >- <entity name="SmallProject" class="org.eclipse.persistence.testing.models.performance.SmallProject" access="PROPERTY"> >+ <entity name="SmallProject" class="org.eclipse.persistence.testing.models.jpa.performance.SmallProject" access="PROPERTY"> > <table name="SPROJECT"/> > <discriminator-value>S</discriminator-value> > </entity> >- <entity name="Project" class="org.eclipse.persistence.testing.models.performance.Project" access="PROPERTY"> >+ <entity name="Project" class="org.eclipse.persistence.testing.models.jpa.performance.Project" access="PROPERTY"> > <table name="PROJECT"/> > <inheritance strategy="JOINED"/> > <discriminator-value>P</discriminator-value> >@@ -144,12 +147,12 @@ > <version name="version"> > <column name="VERSION"/> > </version> >- <many-to-one name="teamLeader" target-entity="org.eclipse.persistence.testing.models.performance.Employee" fetch="LAZY"> >+ <many-to-one name="teamLeader" target-entity="org.eclipse.persistence.testing.models.jpa.performance.Employee" fetch="LAZY"> > <join-column name="LEADER_ID"/> > </many-to-one> > </attributes> > </entity> >- <embeddable class="org.eclipse.persistence.testing.models.performance.EmploymentPeriod" access="PROPERTY"> >+ <embeddable class="org.eclipse.persistence.testing.models.jpa.performance.EmploymentPeriod" access="PROPERTY"> > <attributes> > <basic name="startDate"> > <column name="START_DATE"/> >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java (working copy) >@@ -34,14 +34,14 @@ > * Provides convenience methods for transactional access as well as to access > * login information and to create any sessions required for setup. > * >- * Assumes the existence of a titl.properties file on the classpath that defines the >+ * Assumes the existence of a test.properties file on the classpath that defines the > * following properties: > * >- * login.databaseplatform >- * login.username >- * login.password >- * login.databaseURL >- * login.driverClass >+ * db.platform >+ * db.user >+ * db.pwd >+ * db.url >+ * db.driver > * > * If you are using the TestingBrowser, these properties come from the login panel instead. > * If you are running the test in JEE the properties come from the server config. >@@ -353,7 +353,6 @@ > */ > public void runBareClient() throws Throwable { > Properties properties = new Properties(); >- // TODO: make url platform independent. > String url = System.getProperty("server.url"); > if (url == null) { > fail("System property 'server.url' must be set."); >@@ -386,11 +385,20 @@ > > /** > * Used by subclasses to pass any properties into the >- * server's vm. Should be used with caution! >+ * server's vm. Should be used with caution. > */ > protected Properties getServerProperties() { > return null; > } > >+ /** >+ * Verifies that the object was merged to the cache, and written to the database correctly. >+ */ >+ public void verifyObject(Object writtenObject) { >+ Object readObject = getServerSession().readObject(writtenObject); >+ if (!getServerSession().compareObjects(readObject, writtenObject)) { >+ fail("Object: " + readObject + " does not match object that was written: " + writtenObject + ". See log (on finest) for what did not match."); >+ } >+ } > > } >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Employee.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Employee.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Employee.java (revision 0) >@@ -0,0 +1,210 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.util.*; >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Represent a employee of an organization. >+ * <p><b>Description</b>: An Employee is a root object in the Employee Demo. >+ * It maintains relationships to all of the other objects in the system. >+ */ >+public class Employee implements Serializable { >+ >+ protected long id; >+ protected long version; >+ protected String firstName; >+ protected String lastName; >+ protected String gender; >+ protected EmploymentPeriod period; >+ protected Address address; >+ protected Employee manager; >+ protected Collection managedEmployees; >+ protected Collection phoneNumbers; >+ public Collection projects; >+ protected int salary; >+ >+ public Employee() { >+ this.firstName = ""; >+ this.lastName = ""; >+ this.managedEmployees = new HashSet(); >+ this.projects = new HashSet(); >+ this.phoneNumbers = new HashSet(); >+ } >+ >+ /** >+ * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it. >+ */ >+ public void addManagedEmployee(Employee employee) { >+ getManagedEmployees().add(employee); >+ employee.setManager(this); >+ } >+ >+ /** >+ * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it. >+ */ >+ public void addPhoneNumber(PhoneNumber phoneNumber) { >+ getPhoneNumbers().add(phoneNumber); >+ phoneNumber.setOwner(this); >+ } >+ >+ public void addProject(Project project) { >+ getProjects().add(project); >+ } >+ >+ public Address getAddress() { >+ return address; >+ } >+ >+ public String getFirstName() { >+ return firstName; >+ } >+ >+ public String getGender() { >+ return gender; >+ } >+ >+ /** >+ * Return the persistent identifier of the receiver. >+ */ >+ public long getId() { >+ return id; >+ } >+ >+ public String getLastName() { >+ return lastName; >+ } >+ >+ public Collection getManagedEmployees() { >+ return managedEmployees; >+ } >+ >+ public Employee getManager() { >+ return manager; >+ } >+ >+ public EmploymentPeriod getPeriod() { >+ return period; >+ } >+ >+ public Collection getPhoneNumbers() { >+ return phoneNumbers; >+ } >+ >+ public Collection getProjects() { >+ return projects; >+ } >+ >+ public int getSalary() { >+ return salary; >+ } >+ >+ public long getVersion() { >+ return version; >+ } >+ >+ public void removeManagedEmployee(Employee employee) { >+ getManagedEmployees().remove(employee); >+ employee.setManager(null); >+ } >+ >+ /** >+ * Remove the phone number. >+ * The phone number's owner must not be set to null as it is part of it primary key, >+ * and you can never change the primary key of an existing object. >+ * Only in independent relationships should you null out the back reference. >+ */ >+ public void removePhoneNumber(PhoneNumber phoneNumber) { >+ getPhoneNumbers().remove(phoneNumber); >+ } >+ >+ public void removeProject(Project project) { >+ getProjects().remove(project); >+ } >+ >+ public void setAddress(Address address) { >+ this.address = address; >+ } >+ >+ public void setFemale() { >+ setGender("Female"); >+ } >+ >+ public void setFirstName(String firstName) { >+ this.firstName = firstName; >+ } >+ >+ public void setGender(String gender) { >+ this.gender = gender; >+ } >+ >+ /** >+ * Set the persistent identifier of the receiver. >+ * Note this should never be changed. >+ * Consider making the primary key set methods protected or not having them. >+ * In this demo the setId is required for testing purposes. >+ */ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ public void setLastName(String lastName) { >+ this.lastName = lastName; >+ } >+ >+ public void setMale() { >+ setGender("Male"); >+ } >+ >+ public void setManagedEmployees(Collection managedEmployees) { >+ this.managedEmployees = managedEmployees; >+ } >+ >+ public void setManager(Employee manager) { >+ this.manager = manager; >+ } >+ >+ public void setPeriod(EmploymentPeriod period) { >+ this.period = period; >+ } >+ >+ public void setPhoneNumbers(Collection phoneNumbers) { >+ this.phoneNumbers = phoneNumbers; >+ } >+ >+ public void setProjects(Collection projects) { >+ this.projects = projects; >+ } >+ >+ public void setSalary(int salary) { >+ this.salary = salary; >+ } >+ >+ public void setVersion(long version) { >+ this.version = version; >+ } >+ >+ /** >+ * Print the first & last name >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("Employee: "); >+ writer.write(getFirstName()); >+ writer.write(" "); >+ writer.write(getLastName()); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/SmallProject.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/SmallProject.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/SmallProject.java (revision 0) >@@ -0,0 +1,35 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+/** >+ * <p><b>Purpose</b>: SmallProject is a concrete subclass of Project which adds no additional attributes. >+ * <p><b>Description</b>: When the PROJ_TYPE is set to 'S' in the PROJECT table a SmallProject is instantiated. >+ * No table definition is required and the descriptor is very simple. >+ */ >+public class SmallProject extends Project { >+ >+ /** >+ * Print the SmallProject's information. >+ */ >+ public String toString() { >+ java.io.StringWriter writer = new java.io.StringWriter(); >+ >+ writer.write("Small Project: "); >+ writer.write(getName()); >+ writer.write(" "); >+ writer.write(getDescription()); >+ writer.write(""); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/LargeProject.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/LargeProject.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/LargeProject.java (revision 0) >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+import java.sql.Timestamp; >+ >+/** >+ * <b>Purpose</b>: Larger scale projects within the Employee Demo >+ * <p><b>Description</b>: LargeProject is a concrete subclass of Project. It is instantiated for Projects with type = 'L'. The additional >+ * information (budget, & milestoneVersion) are mapped from the LPROJECT table. >+ * @see Project >+ */ >+public class LargeProject extends Project { >+ protected double budget; >+ protected Timestamp milestoneVersion; >+ >+ public LargeProject() { >+ this.budget = 0.0; >+ } >+ >+ public double getBudget() { >+ return budget; >+ } >+ >+ public Timestamp getMilestoneVersion() { >+ return milestoneVersion; >+ } >+ >+ public void setBudget(double budget) { >+ this.budget = budget; >+ } >+ >+ public void setMilestoneVersion(Timestamp milestoneVersion) { >+ this.milestoneVersion = milestoneVersion; >+ } >+ >+ /** >+ * Print the project's data. >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("Large Project: "); >+ writer.write(getName()); >+ writer.write(" "); >+ writer.write(getDescription()); >+ writer.write(" " + getBudget()); >+ writer.write(" "); >+ writer.write(String.valueOf(getMilestoneVersion())); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/PhoneNumber.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/PhoneNumber.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/PhoneNumber.java (revision 0) >@@ -0,0 +1,131 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Describes an Employee's phone number. >+ * <p><b>Description</b>: Used in a 1:M relationship from an employee. Since many people have various numbers >+ * they can be contacted at the type describes where the phone number could reach the Employee. >+ */ >+public class PhoneNumber implements Serializable { >+ >+ /** Sequence id, added for Hibernate as it has issues with composite ids and caching. */ >+ protected long id; >+ >+ /** Holds values such as Home, Work, Cellular, Pager, Fax, etc. Since the combination of the Employee's ID and >+ the type field are what makes the entry in the database unique the type fields must be unique within an >+ Employee's Vector of PhoneNumbers.*/ >+ protected String type; >+ protected String areaCode; >+ >+ /** 7 digit number with no hyphen, this is added during toString() only*/ >+ protected String number; >+ >+ /** Owner maintains the 1:1 mapping to an Employee (required for 1:M relationship in Employee) */ >+ protected Employee owner; >+ >+ public PhoneNumber() { >+ this("home", "###", "#######"); >+ } >+ >+ public PhoneNumber(String type, String theAreaCode, String theNumber) { >+ this.type = type; >+ this.areaCode = theAreaCode; >+ this.number = theNumber; >+ } >+ >+ public String getAreaCode() { >+ return areaCode; >+ } >+ >+ public String getNumber() { >+ return number; >+ } >+ >+ public Employee getOwner() { >+ return owner; >+ } >+ >+ public String getType() { >+ return type; >+ } >+ >+ public long getId() { >+ return id; >+ } >+ >+ public void setAreaCode(String areaCode) { >+ this.areaCode = areaCode; >+ } >+ >+ public void setNumber(String number) { >+ this.number = number; >+ } >+ >+ public void setOwner(Employee owner) { >+ this.owner = owner; >+ } >+ >+ public void setType(String type) { >+ this.type = type; >+ } >+ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ /** >+ * Required for Hibernate cache to work. >+ */ >+ public int hashCode() { >+ return getType().hashCode(); >+ } >+ >+ /** >+ * Required for Hibernate cache to work. >+ */ >+ public boolean equals(Object object) { >+ if (object instanceof PhoneNumber) { >+ PhoneNumber phone = (PhoneNumber)object; >+ if (! getType().equals(phone.getType())) { >+ return false; >+ } >+ if ((getOwner() == null) || (phone.getOwner() == null) || (getOwner().getId() != phone.getOwner().getId())) { >+ return false; >+ } >+ return true; >+ } else { >+ return false; >+ } >+ } >+ >+ /** >+ * Print the phone. >+ * Example: Phone[Work]: (613) 225-8812 >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("PhoneNumber ["); >+ writer.write(getType()); >+ writer.write("]: ("); >+ writer.write(this.getAreaCode()); >+ writer.write(")"); >+ writer.write(this.getNumber().substring(0, 3)); >+ writer.write("-"); >+ writer.write(this.getNumber().substring(3, 7)); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Address.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Address.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Address.java (revision 0) >@@ -0,0 +1,112 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Represents the mailing address on an Employee >+ * <p><b>Description</b>: Held in a private 1:1 relationship from Employee >+ * @see Employee >+ */ >+public class Address implements Serializable { >+ protected long id; >+ protected String street; >+ protected String city; >+ protected String province; >+ protected String postalCode; >+ protected String country; >+ >+ public Address() { >+ this.city = ""; >+ this.province = ""; >+ this.postalCode = ""; >+ this.street = ""; >+ this.country = ""; >+ } >+ >+ public String getCity() { >+ return city; >+ } >+ >+ public String getCountry() { >+ return country; >+ } >+ >+ /** >+ * Return the persistent identifier of the receiver. >+ */ >+ public long getId() { >+ return id; >+ } >+ >+ public String getPostalCode() { >+ return postalCode; >+ } >+ >+ public String getProvince() { >+ return province; >+ } >+ >+ public String getStreet() { >+ return street; >+ } >+ >+ public void setCity(String city) { >+ this.city = city; >+ } >+ >+ public void setCountry(String country) { >+ this.country = country; >+ } >+ >+ /** >+ * Set the persistent identifier of the receiver. >+ */ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ public void setPostalCode(String postalCode) { >+ this.postalCode = postalCode; >+ } >+ >+ public void setProvince(String province) { >+ this.province = province; >+ } >+ >+ public void internalSetStreet(String street) { >+ this.street = street; >+ } >+ >+ public void setStreet(String street) { >+ this.street = street; >+ } >+ >+ /** >+ * Print the address city and province. >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("Address: "); >+ writer.write(getStreet()); >+ writer.write(", "); >+ writer.write(getCity()); >+ writer.write(", "); >+ writer.write(getProvince()); >+ writer.write(", "); >+ writer.write(getCountry()); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Project.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Project.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Project.java (revision 0) >@@ -0,0 +1,83 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+ >+/** >+ * <b>Purpose</b>: Abstract superclass for Large & Small projects in Employee Demo >+ * <p><b>Description</b>: Project is an example of an abstract superclass. It demonstrates how class inheritance can be mapped to database tables. >+ * It's subclasses are concrete and may or may not add columns through additional tables. The PROJ_TYPE field in the >+ * database table indicates which subclass to instantiate. Projects are involved in a M:M relationship with employees. >+ * The Employee classs maintains the definition of the relation table. >+ * @see LargeProject >+ * @see SmallProject >+ */ >+public abstract class Project implements Serializable { >+ protected long id; >+ protected long version; >+ protected String name; >+ protected String description; >+ protected Employee teamLeader; >+ >+ public Project() { >+ this.name = ""; >+ this.description = ""; >+ } >+ >+ public String getDescription() { >+ return description; >+ } >+ >+ /** >+ * Return the persistent identifier of the receiver. >+ */ >+ public long getId() { >+ return id; >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public Employee getTeamLeader() { >+ return teamLeader; >+ } >+ >+ public long getVersion() { >+ return version; >+ } >+ >+ public void setDescription(String description) { >+ this.description = description; >+ } >+ >+ /** >+ * Set the persistent identifier of the receiver. >+ */ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ public void setName(String name) { >+ this.name = name; >+ } >+ >+ public void setTeamLeader(Employee teamLeader) { >+ this.teamLeader = teamLeader; >+ } >+ >+ public void setVersion(long version) { >+ this.version = version; >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmployeeTableCreator.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmployeeTableCreator.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmployeeTableCreator.java (revision 0) >@@ -0,0 +1,509 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import org.eclipse.persistence.tools.schemaframework.*; >+ >+/** >+ * TopLink generated Project class. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+public class EmployeeTableCreator extends TableCreator { >+ >+ /** >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ public EmployeeTableCreator() { >+ applyPROJECT(); >+ buildADDRESSTable(); >+ buildEMPLOYEETable(); >+ buildSPROJECTTable(); >+ buildLPROJECTTable(); >+ buildPHONETable(); >+ buildPROJ_EMPTable(); >+ buildPROJECTTable(); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void applyPROJECT() { >+ setName("Employee"); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildADDRESSTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("ADDRESS"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("ADDRESS_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(true); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("P_CODE"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(20); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("CITY"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(80); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("PROVINCE"); >+ field3.setTypeName("VARCHAR"); >+ field3.setSize(80); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ >+ // SECTION: FIELD >+ FieldDefinition field4 = new FieldDefinition(); >+ field4.setName("STREET"); >+ field4.setTypeName("VARCHAR"); >+ field4.setSize(80); >+ field4.setShouldAllowNull(true); >+ field4.setIsPrimaryKey(false); >+ field4.setUnique(false); >+ field4.setIsIdentity(false); >+ tabledefinition.addField(field4); >+ >+ // SECTION: FIELD >+ FieldDefinition field5 = new FieldDefinition(); >+ field5.setName("COUNTRY"); >+ field5.setTypeName("VARCHAR"); >+ field5.setSize(80); >+ field5.setShouldAllowNull(true); >+ field5.setIsPrimaryKey(false); >+ field5.setUnique(false); >+ field5.setIsIdentity(false); >+ tabledefinition.addField(field5); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildEMPLOYEETable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("EMPLOYEE"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("EMP_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(true); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("F_NAME"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(40); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("L_NAME"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(40); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition salary = new FieldDefinition(); >+ salary.setName("SALARY"); >+ salary.setTypeName("INT"); >+ salary.setSize(10); >+ salary.setShouldAllowNull(true); >+ salary.setIsPrimaryKey(false); >+ salary.setUnique(false); >+ salary.setIsIdentity(false); >+ tabledefinition.addField(salary); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("START_DATE"); >+ field3.setTypeName("DATE"); >+ field3.setSize(23); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ >+ // SECTION: FIELD >+ FieldDefinition field4 = new FieldDefinition(); >+ field4.setName("END_DATE"); >+ field4.setTypeName("DATE"); >+ field4.setSize(23); >+ field4.setShouldAllowNull(true); >+ field4.setIsPrimaryKey(false); >+ field4.setUnique(false); >+ field4.setIsIdentity(false); >+ tabledefinition.addField(field4); >+ >+ // SECTION: FIELD >+ FieldDefinition field7 = new FieldDefinition(); >+ field7.setName("GENDER"); >+ field7.setTypeName("VARCHAR"); >+ field7.setSize(10); >+ field7.setShouldAllowNull(true); >+ field7.setIsPrimaryKey(false); >+ field7.setUnique(false); >+ field7.setIsIdentity(false); >+ tabledefinition.addField(field7); >+ >+ // SECTION: FIELD >+ FieldDefinition field8 = new FieldDefinition(); >+ field8.setName("ADDR_ID"); >+ field8.setTypeName("NUMERIC"); >+ field8.setSize(15); >+ field8.setShouldAllowNull(true); >+ field8.setIsPrimaryKey(false); >+ field8.setUnique(false); >+ field8.setIsIdentity(false); >+ field8.setForeignKeyFieldName("ADDRESS.ADDRESS_ID"); >+ tabledefinition.addField(field8); >+ >+ // SECTION: FIELD >+ FieldDefinition field9 = new FieldDefinition(); >+ field9.setName("MANAGER_ID"); >+ field9.setTypeName("NUMERIC"); >+ field9.setSize(15); >+ field9.setShouldAllowNull(true); >+ field9.setIsPrimaryKey(false); >+ field9.setUnique(false); >+ field9.setIsIdentity(false); >+ field9.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field9); >+ >+ // SECTION: FIELD >+ FieldDefinition field10 = new FieldDefinition(); >+ field10.setName("VERSION"); >+ field10.setTypeName("NUMERIC"); >+ field10.setSize(15); >+ field10.setShouldAllowNull(true); >+ field10.setIsPrimaryKey(false); >+ field10.setUnique(false); >+ field10.setIsIdentity(false); >+ tabledefinition.addField(field10); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildLPROJECTTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("LPROJECT"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("PROJ_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("PROJECT.PROJ_ID"); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("BUDGET"); >+ field1.setTypeName("DOUBLE PRECIS"); >+ field1.setSize(32); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("MILESTONE"); >+ field2.setTypeName("DATETIME"); >+ field2.setSize(23); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildSPROJECTTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("SPROJECT"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("PROJ_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("PROJECT.PROJ_ID"); >+ tabledefinition.addField(field); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildPHONETable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("PHONE"); >+ >+ // SECTION: FIELD >+ FieldDefinition field0 = new FieldDefinition(); >+ field0.setName("PHONE_ID"); >+ field0.setTypeName("NUMERIC"); >+ field0.setSize(15); >+ field0.setShouldAllowNull(false); >+ field0.setIsPrimaryKey(true); >+ field0.setUnique(false); >+ field0.setIsIdentity(true); >+ tabledefinition.addField(field0); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("EMP_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(false); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("TYPE"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(15); >+ field1.setShouldAllowNull(false); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("AREA_CODE"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(3); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("P_NUMBER"); >+ field3.setTypeName("VARCHAR"); >+ field3.setSize(7); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildPROJ_EMPTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("PROJ_EMP"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("EMP_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("PROJ_ID"); >+ field1.setTypeName("NUMERIC"); >+ field1.setSize(15); >+ field1.setShouldAllowNull(false); >+ field1.setIsPrimaryKey(true); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ field1.setForeignKeyFieldName("PROJECT.PROJ_ID"); >+ tabledefinition.addField(field1); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildPROJECTTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("PROJECT"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("PROJ_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(true); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("PROJ_TYPE"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(1); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("PROJ_NAME"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(30); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("DESCRIP"); >+ field3.setTypeName("VARCHAR"); >+ field3.setSize(200); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ >+ // SECTION: FIELD >+ FieldDefinition field4 = new FieldDefinition(); >+ field4.setName("LEADER_ID"); >+ field4.setTypeName("NUMERIC"); >+ field4.setSize(15); >+ field4.setShouldAllowNull(true); >+ field4.setIsPrimaryKey(false); >+ field4.setUnique(false); >+ field4.setIsIdentity(false); >+ field4.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field4); >+ >+ // SECTION: FIELD >+ FieldDefinition field5 = new FieldDefinition(); >+ field5.setName("VERSION"); >+ field5.setTypeName("NUMERIC"); >+ field5.setSize(15); >+ field5.setShouldAllowNull(true); >+ field5.setIsPrimaryKey(false); >+ field5.setUnique(false); >+ field5.setIsIdentity(false); >+ tabledefinition.addField(field5); >+ addTableDefinition(tabledefinition); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmploymentPeriod.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmploymentPeriod.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmploymentPeriod.java (revision 0) >@@ -0,0 +1,76 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.sql.Date; >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Defines the period an Employee worked for the organization >+ * <p><b>Description</b>: The period holds the start date and optionally the end date if the employee has left (null otherwise). >+ * Maintained in an aggregate relationship of Employee >+ * @see Employee >+ */ >+public class EmploymentPeriod implements Serializable { >+ protected Date startDate; >+ protected Date endDate; >+ >+ public EmploymentPeriod() { >+ } >+ >+ /** >+ * Return a new employment period instance. >+ * The constructor's purpose is to allow only valid instances of a class to be created. >+ * Valid means that the get/set and clone/toString methods should work on the instance. >+ * Arguments to constructors should be avoided unless those arguments are required to put >+ * the instance into a valid state, or represent the entire instance definition. >+ */ >+ public EmploymentPeriod(Date startDate, Date endDate) { >+ this.startDate = startDate; >+ this.endDate = endDate; >+ >+ } >+ >+ public Date getEndDate() { >+ return endDate; >+ } >+ >+ public Date getStartDate() { >+ return startDate; >+ } >+ >+ public void setEndDate(Date endDate) { >+ this.endDate = endDate; >+ } >+ >+ public void setStartDate(Date startDate) { >+ this.startDate = startDate; >+ } >+ >+ /** >+ * Print the start & end date >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("EmploymentPeriod: "); >+ if (getStartDate() != null) { >+ writer.write(getStartDate().toString()); >+ } >+ writer.write("-"); >+ if (getEndDate() != null) { >+ writer.write(getEndDate().toString()); >+ } >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Address.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Address.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Address.java (revision 0) >@@ -0,0 +1,112 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Represents the mailing address on an Employee >+ * <p><b>Description</b>: Held in a private 1:1 relationship from Employee >+ * @see Employee >+ */ >+public class Address implements Serializable { >+ protected long id; >+ protected String street; >+ protected String city; >+ protected String province; >+ protected String postalCode; >+ protected String country; >+ >+ public Address() { >+ this.city = ""; >+ this.province = ""; >+ this.postalCode = ""; >+ this.street = ""; >+ this.country = ""; >+ } >+ >+ public String getCity() { >+ return city; >+ } >+ >+ public String getCountry() { >+ return country; >+ } >+ >+ /** >+ * Return the persistent identifier of the receiver. >+ */ >+ public long getId() { >+ return id; >+ } >+ >+ public String getPostalCode() { >+ return postalCode; >+ } >+ >+ public String getProvince() { >+ return province; >+ } >+ >+ public String getStreet() { >+ return street; >+ } >+ >+ public void setCity(String city) { >+ this.city = city; >+ } >+ >+ public void setCountry(String country) { >+ this.country = country; >+ } >+ >+ /** >+ * Set the persistent identifier of the receiver. >+ */ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ public void setPostalCode(String postalCode) { >+ this.postalCode = postalCode; >+ } >+ >+ public void setProvince(String province) { >+ this.province = province; >+ } >+ >+ public void internalSetStreet(String street) { >+ this.street = street; >+ } >+ >+ public void setStreet(String street) { >+ this.street = street; >+ } >+ >+ /** >+ * Print the address city and province. >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("Address: "); >+ writer.write(getStreet()); >+ writer.write(", "); >+ writer.write(getCity()); >+ writer.write(", "); >+ writer.write(getProvince()); >+ writer.write(", "); >+ writer.write(getCountry()); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Employee.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Employee.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Employee.java (revision 0) >@@ -0,0 +1,210 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.util.*; >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Represent a employee of an organization. >+ * <p><b>Description</b>: An Employee is a root object in the Employee Demo. >+ * It maintains relationships to all of the other objects in the system. >+ */ >+public class Employee implements Serializable { >+ >+ protected long id; >+ protected long version; >+ protected String firstName; >+ protected String lastName; >+ protected String gender; >+ protected EmploymentPeriod period; >+ protected Address address; >+ protected Employee manager; >+ protected Collection managedEmployees; >+ protected Collection phoneNumbers; >+ public Collection projects; >+ protected int salary; >+ >+ public Employee() { >+ this.firstName = ""; >+ this.lastName = ""; >+ this.managedEmployees = new HashSet(); >+ this.projects = new HashSet(); >+ this.phoneNumbers = new HashSet(); >+ } >+ >+ /** >+ * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it. >+ */ >+ public void addManagedEmployee(Employee employee) { >+ getManagedEmployees().add(employee); >+ employee.setManager(this); >+ } >+ >+ /** >+ * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it. >+ */ >+ public void addPhoneNumber(PhoneNumber phoneNumber) { >+ getPhoneNumbers().add(phoneNumber); >+ phoneNumber.setOwner(this); >+ } >+ >+ public void addProject(Project project) { >+ getProjects().add(project); >+ } >+ >+ public Address getAddress() { >+ return address; >+ } >+ >+ public String getFirstName() { >+ return firstName; >+ } >+ >+ public String getGender() { >+ return gender; >+ } >+ >+ /** >+ * Return the persistent identifier of the receiver. >+ */ >+ public long getId() { >+ return id; >+ } >+ >+ public String getLastName() { >+ return lastName; >+ } >+ >+ public Collection getManagedEmployees() { >+ return managedEmployees; >+ } >+ >+ public Employee getManager() { >+ return manager; >+ } >+ >+ public EmploymentPeriod getPeriod() { >+ return period; >+ } >+ >+ public Collection getPhoneNumbers() { >+ return phoneNumbers; >+ } >+ >+ public Collection getProjects() { >+ return projects; >+ } >+ >+ public int getSalary() { >+ return salary; >+ } >+ >+ public long getVersion() { >+ return version; >+ } >+ >+ public void removeManagedEmployee(Employee employee) { >+ getManagedEmployees().remove(employee); >+ employee.setManager(null); >+ } >+ >+ /** >+ * Remove the phone number. >+ * The phone number's owner must not be set to null as it is part of it primary key, >+ * and you can never change the primary key of an existing object. >+ * Only in independent relationships should you null out the back reference. >+ */ >+ public void removePhoneNumber(PhoneNumber phoneNumber) { >+ getPhoneNumbers().remove(phoneNumber); >+ } >+ >+ public void removeProject(Project project) { >+ getProjects().remove(project); >+ } >+ >+ public void setAddress(Address address) { >+ this.address = address; >+ } >+ >+ public void setFemale() { >+ setGender("Female"); >+ } >+ >+ public void setFirstName(String firstName) { >+ this.firstName = firstName; >+ } >+ >+ public void setGender(String gender) { >+ this.gender = gender; >+ } >+ >+ /** >+ * Set the persistent identifier of the receiver. >+ * Note this should never be changed. >+ * Consider making the primary key set methods protected or not having them. >+ * In this demo the setId is required for testing purposes. >+ */ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ public void setLastName(String lastName) { >+ this.lastName = lastName; >+ } >+ >+ public void setMale() { >+ setGender("Male"); >+ } >+ >+ public void setManagedEmployees(Collection managedEmployees) { >+ this.managedEmployees = managedEmployees; >+ } >+ >+ public void setManager(Employee manager) { >+ this.manager = manager; >+ } >+ >+ public void setPeriod(EmploymentPeriod period) { >+ this.period = period; >+ } >+ >+ public void setPhoneNumbers(Collection phoneNumbers) { >+ this.phoneNumbers = phoneNumbers; >+ } >+ >+ public void setProjects(Collection projects) { >+ this.projects = projects; >+ } >+ >+ public void setSalary(int salary) { >+ this.salary = salary; >+ } >+ >+ public void setVersion(long version) { >+ this.version = version; >+ } >+ >+ /** >+ * Print the first & last name >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("Employee: "); >+ writer.write(getFirstName()); >+ writer.write(" "); >+ writer.write(getLastName()); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmployeeTableCreator.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmployeeTableCreator.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmployeeTableCreator.java (revision 0) >@@ -0,0 +1,509 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import org.eclipse.persistence.tools.schemaframework.*; >+ >+/** >+ * TopLink generated Project class. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+public class EmployeeTableCreator extends TableCreator { >+ >+ /** >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ public EmployeeTableCreator() { >+ applyPROJECT(); >+ buildADDRESSTable(); >+ buildEMPLOYEETable(); >+ buildSPROJECTTable(); >+ buildLPROJECTTable(); >+ buildPHONETable(); >+ buildPROJ_EMPTable(); >+ buildPROJECTTable(); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void applyPROJECT() { >+ setName("Employee"); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildADDRESSTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("ADDRESS"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("ADDRESS_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(true); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("P_CODE"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(20); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("CITY"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(80); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("PROVINCE"); >+ field3.setTypeName("VARCHAR"); >+ field3.setSize(80); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ >+ // SECTION: FIELD >+ FieldDefinition field4 = new FieldDefinition(); >+ field4.setName("STREET"); >+ field4.setTypeName("VARCHAR"); >+ field4.setSize(80); >+ field4.setShouldAllowNull(true); >+ field4.setIsPrimaryKey(false); >+ field4.setUnique(false); >+ field4.setIsIdentity(false); >+ tabledefinition.addField(field4); >+ >+ // SECTION: FIELD >+ FieldDefinition field5 = new FieldDefinition(); >+ field5.setName("COUNTRY"); >+ field5.setTypeName("VARCHAR"); >+ field5.setSize(80); >+ field5.setShouldAllowNull(true); >+ field5.setIsPrimaryKey(false); >+ field5.setUnique(false); >+ field5.setIsIdentity(false); >+ tabledefinition.addField(field5); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildEMPLOYEETable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("EMPLOYEE"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("EMP_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(true); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("F_NAME"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(40); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("L_NAME"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(40); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition salary = new FieldDefinition(); >+ salary.setName("SALARY"); >+ salary.setTypeName("INT"); >+ salary.setSize(10); >+ salary.setShouldAllowNull(true); >+ salary.setIsPrimaryKey(false); >+ salary.setUnique(false); >+ salary.setIsIdentity(false); >+ tabledefinition.addField(salary); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("START_DATE"); >+ field3.setTypeName("DATE"); >+ field3.setSize(23); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ >+ // SECTION: FIELD >+ FieldDefinition field4 = new FieldDefinition(); >+ field4.setName("END_DATE"); >+ field4.setTypeName("DATE"); >+ field4.setSize(23); >+ field4.setShouldAllowNull(true); >+ field4.setIsPrimaryKey(false); >+ field4.setUnique(false); >+ field4.setIsIdentity(false); >+ tabledefinition.addField(field4); >+ >+ // SECTION: FIELD >+ FieldDefinition field7 = new FieldDefinition(); >+ field7.setName("GENDER"); >+ field7.setTypeName("VARCHAR"); >+ field7.setSize(10); >+ field7.setShouldAllowNull(true); >+ field7.setIsPrimaryKey(false); >+ field7.setUnique(false); >+ field7.setIsIdentity(false); >+ tabledefinition.addField(field7); >+ >+ // SECTION: FIELD >+ FieldDefinition field8 = new FieldDefinition(); >+ field8.setName("ADDR_ID"); >+ field8.setTypeName("NUMERIC"); >+ field8.setSize(15); >+ field8.setShouldAllowNull(true); >+ field8.setIsPrimaryKey(false); >+ field8.setUnique(false); >+ field8.setIsIdentity(false); >+ field8.setForeignKeyFieldName("ADDRESS.ADDRESS_ID"); >+ tabledefinition.addField(field8); >+ >+ // SECTION: FIELD >+ FieldDefinition field9 = new FieldDefinition(); >+ field9.setName("MANAGER_ID"); >+ field9.setTypeName("NUMERIC"); >+ field9.setSize(15); >+ field9.setShouldAllowNull(true); >+ field9.setIsPrimaryKey(false); >+ field9.setUnique(false); >+ field9.setIsIdentity(false); >+ field9.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field9); >+ >+ // SECTION: FIELD >+ FieldDefinition field10 = new FieldDefinition(); >+ field10.setName("VERSION"); >+ field10.setTypeName("NUMERIC"); >+ field10.setSize(15); >+ field10.setShouldAllowNull(true); >+ field10.setIsPrimaryKey(false); >+ field10.setUnique(false); >+ field10.setIsIdentity(false); >+ tabledefinition.addField(field10); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildLPROJECTTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("LPROJECT"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("PROJ_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("PROJECT.PROJ_ID"); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("BUDGET"); >+ field1.setTypeName("DOUBLE PRECIS"); >+ field1.setSize(32); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("MILESTONE"); >+ field2.setTypeName("DATETIME"); >+ field2.setSize(23); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildSPROJECTTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("SPROJECT"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("PROJ_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("PROJECT.PROJ_ID"); >+ tabledefinition.addField(field); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildPHONETable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("PHONE"); >+ >+ // SECTION: FIELD >+ FieldDefinition field0 = new FieldDefinition(); >+ field0.setName("PHONE_ID"); >+ field0.setTypeName("NUMERIC"); >+ field0.setSize(15); >+ field0.setShouldAllowNull(false); >+ field0.setIsPrimaryKey(true); >+ field0.setUnique(false); >+ field0.setIsIdentity(true); >+ tabledefinition.addField(field0); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("EMP_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(false); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("TYPE"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(15); >+ field1.setShouldAllowNull(false); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("AREA_CODE"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(3); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("P_NUMBER"); >+ field3.setTypeName("VARCHAR"); >+ field3.setSize(7); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildPROJ_EMPTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("PROJ_EMP"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("EMP_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(false); >+ field.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("PROJ_ID"); >+ field1.setTypeName("NUMERIC"); >+ field1.setSize(15); >+ field1.setShouldAllowNull(false); >+ field1.setIsPrimaryKey(true); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ field1.setForeignKeyFieldName("PROJECT.PROJ_ID"); >+ tabledefinition.addField(field1); >+ addTableDefinition(tabledefinition); >+ } >+ >+ /** >+ * TopLink generated method. >+ * <b>WARNING</b>: This code was generated by an automated tool. >+ * Any changes will be lost when the code is re-generated >+ */ >+ protected void buildPROJECTTable() { >+ TableDefinition tabledefinition = new TableDefinition(); >+ >+ // SECTION: TABLE >+ tabledefinition.setName("PROJECT"); >+ >+ // SECTION: FIELD >+ FieldDefinition field = new FieldDefinition(); >+ field.setName("PROJ_ID"); >+ field.setTypeName("NUMERIC"); >+ field.setSize(15); >+ field.setShouldAllowNull(false); >+ field.setIsPrimaryKey(true); >+ field.setUnique(false); >+ field.setIsIdentity(true); >+ tabledefinition.addField(field); >+ >+ // SECTION: FIELD >+ FieldDefinition field1 = new FieldDefinition(); >+ field1.setName("PROJ_TYPE"); >+ field1.setTypeName("VARCHAR"); >+ field1.setSize(1); >+ field1.setShouldAllowNull(true); >+ field1.setIsPrimaryKey(false); >+ field1.setUnique(false); >+ field1.setIsIdentity(false); >+ tabledefinition.addField(field1); >+ >+ // SECTION: FIELD >+ FieldDefinition field2 = new FieldDefinition(); >+ field2.setName("PROJ_NAME"); >+ field2.setTypeName("VARCHAR"); >+ field2.setSize(30); >+ field2.setShouldAllowNull(true); >+ field2.setIsPrimaryKey(false); >+ field2.setUnique(false); >+ field2.setIsIdentity(false); >+ tabledefinition.addField(field2); >+ >+ // SECTION: FIELD >+ FieldDefinition field3 = new FieldDefinition(); >+ field3.setName("DESCRIP"); >+ field3.setTypeName("VARCHAR"); >+ field3.setSize(200); >+ field3.setShouldAllowNull(true); >+ field3.setIsPrimaryKey(false); >+ field3.setUnique(false); >+ field3.setIsIdentity(false); >+ tabledefinition.addField(field3); >+ >+ // SECTION: FIELD >+ FieldDefinition field4 = new FieldDefinition(); >+ field4.setName("LEADER_ID"); >+ field4.setTypeName("NUMERIC"); >+ field4.setSize(15); >+ field4.setShouldAllowNull(true); >+ field4.setIsPrimaryKey(false); >+ field4.setUnique(false); >+ field4.setIsIdentity(false); >+ field4.setForeignKeyFieldName("EMPLOYEE.EMP_ID"); >+ tabledefinition.addField(field4); >+ >+ // SECTION: FIELD >+ FieldDefinition field5 = new FieldDefinition(); >+ field5.setName("VERSION"); >+ field5.setTypeName("NUMERIC"); >+ field5.setSize(15); >+ field5.setShouldAllowNull(true); >+ field5.setIsPrimaryKey(false); >+ field5.setUnique(false); >+ field5.setIsIdentity(false); >+ tabledefinition.addField(field5); >+ addTableDefinition(tabledefinition); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmploymentPeriod.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmploymentPeriod.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/EmploymentPeriod.java (revision 0) >@@ -0,0 +1,76 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.sql.Date; >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Defines the period an Employee worked for the organization >+ * <p><b>Description</b>: The period holds the start date and optionally the end date if the employee has left (null otherwise). >+ * Maintained in an aggregate relationship of Employee >+ * @see Employee >+ */ >+public class EmploymentPeriod implements Serializable { >+ protected Date startDate; >+ protected Date endDate; >+ >+ public EmploymentPeriod() { >+ } >+ >+ /** >+ * Return a new employment period instance. >+ * The constructor's purpose is to allow only valid instances of a class to be created. >+ * Valid means that the get/set and clone/toString methods should work on the instance. >+ * Arguments to constructors should be avoided unless those arguments are required to put >+ * the instance into a valid state, or represent the entire instance definition. >+ */ >+ public EmploymentPeriod(Date startDate, Date endDate) { >+ this.startDate = startDate; >+ this.endDate = endDate; >+ >+ } >+ >+ public Date getEndDate() { >+ return endDate; >+ } >+ >+ public Date getStartDate() { >+ return startDate; >+ } >+ >+ public void setEndDate(Date endDate) { >+ this.endDate = endDate; >+ } >+ >+ public void setStartDate(Date startDate) { >+ this.startDate = startDate; >+ } >+ >+ /** >+ * Print the start & end date >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("EmploymentPeriod: "); >+ if (getStartDate() != null) { >+ writer.write(getStartDate().toString()); >+ } >+ writer.write("-"); >+ if (getEndDate() != null) { >+ writer.write(getEndDate().toString()); >+ } >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/LargeProject.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/LargeProject.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/LargeProject.java (revision 0) >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+import java.sql.Timestamp; >+ >+/** >+ * <b>Purpose</b>: Larger scale projects within the Employee Demo >+ * <p><b>Description</b>: LargeProject is a concrete subclass of Project. It is instantiated for Projects with type = 'L'. The additional >+ * information (budget, & milestoneVersion) are mapped from the LPROJECT table. >+ * @see Project >+ */ >+public class LargeProject extends Project { >+ protected double budget; >+ protected Timestamp milestoneVersion; >+ >+ public LargeProject() { >+ this.budget = 0.0; >+ } >+ >+ public double getBudget() { >+ return budget; >+ } >+ >+ public Timestamp getMilestoneVersion() { >+ return milestoneVersion; >+ } >+ >+ public void setBudget(double budget) { >+ this.budget = budget; >+ } >+ >+ public void setMilestoneVersion(Timestamp milestoneVersion) { >+ this.milestoneVersion = milestoneVersion; >+ } >+ >+ /** >+ * Print the project's data. >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("Large Project: "); >+ writer.write(getName()); >+ writer.write(" "); >+ writer.write(getDescription()); >+ writer.write(" " + getBudget()); >+ writer.write(" "); >+ writer.write(String.valueOf(getMilestoneVersion())); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/PhoneNumber.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/PhoneNumber.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/PhoneNumber.java (revision 0) >@@ -0,0 +1,131 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+ >+/** >+ * <p><b>Purpose</b>: Describes an Employee's phone number. >+ * <p><b>Description</b>: Used in a 1:M relationship from an employee. Since many people have various numbers >+ * they can be contacted at the type describes where the phone number could reach the Employee. >+ */ >+public class PhoneNumber implements Serializable { >+ >+ /** Sequence id, added for Hibernate as it has issues with composite ids and caching. */ >+ protected long id; >+ >+ /** Holds values such as Home, Work, Cellular, Pager, Fax, etc. Since the combination of the Employee's ID and >+ the type field are what makes the entry in the database unique the type fields must be unique within an >+ Employee's Vector of PhoneNumbers.*/ >+ protected String type; >+ protected String areaCode; >+ >+ /** 7 digit number with no hyphen, this is added during toString() only*/ >+ protected String number; >+ >+ /** Owner maintains the 1:1 mapping to an Employee (required for 1:M relationship in Employee) */ >+ protected Employee owner; >+ >+ public PhoneNumber() { >+ this("home", "###", "#######"); >+ } >+ >+ public PhoneNumber(String type, String theAreaCode, String theNumber) { >+ this.type = type; >+ this.areaCode = theAreaCode; >+ this.number = theNumber; >+ } >+ >+ public String getAreaCode() { >+ return areaCode; >+ } >+ >+ public String getNumber() { >+ return number; >+ } >+ >+ public Employee getOwner() { >+ return owner; >+ } >+ >+ public String getType() { >+ return type; >+ } >+ >+ public long getId() { >+ return id; >+ } >+ >+ public void setAreaCode(String areaCode) { >+ this.areaCode = areaCode; >+ } >+ >+ public void setNumber(String number) { >+ this.number = number; >+ } >+ >+ public void setOwner(Employee owner) { >+ this.owner = owner; >+ } >+ >+ public void setType(String type) { >+ this.type = type; >+ } >+ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ /** >+ * Required for Hibernate cache to work. >+ */ >+ public int hashCode() { >+ return getType().hashCode(); >+ } >+ >+ /** >+ * Required for Hibernate cache to work. >+ */ >+ public boolean equals(Object object) { >+ if (object instanceof PhoneNumber) { >+ PhoneNumber phone = (PhoneNumber)object; >+ if (! getType().equals(phone.getType())) { >+ return false; >+ } >+ if ((getOwner() == null) || (phone.getOwner() == null) || (getOwner().getId() != phone.getOwner().getId())) { >+ return false; >+ } >+ return true; >+ } else { >+ return false; >+ } >+ } >+ >+ /** >+ * Print the phone. >+ * Example: Phone[Work]: (613) 225-8812 >+ */ >+ public String toString() { >+ StringWriter writer = new StringWriter(); >+ >+ writer.write("PhoneNumber ["); >+ writer.write(getType()); >+ writer.write("]: ("); >+ writer.write(this.getAreaCode()); >+ writer.write(")"); >+ writer.write(this.getNumber().substring(0, 3)); >+ writer.write("-"); >+ writer.write(this.getNumber().substring(3, 7)); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Project.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Project.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/Project.java (revision 0) >@@ -0,0 +1,83 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+import java.io.*; >+ >+/** >+ * <b>Purpose</b>: Abstract superclass for Large & Small projects in Employee Demo >+ * <p><b>Description</b>: Project is an example of an abstract superclass. It demonstrates how class inheritance can be mapped to database tables. >+ * It's subclasses are concrete and may or may not add columns through additional tables. The PROJ_TYPE field in the >+ * database table indicates which subclass to instantiate. Projects are involved in a M:M relationship with employees. >+ * The Employee classs maintains the definition of the relation table. >+ * @see LargeProject >+ * @see SmallProject >+ */ >+public abstract class Project implements Serializable { >+ protected long id; >+ protected long version; >+ protected String name; >+ protected String description; >+ protected Employee teamLeader; >+ >+ public Project() { >+ this.name = ""; >+ this.description = ""; >+ } >+ >+ public String getDescription() { >+ return description; >+ } >+ >+ /** >+ * Return the persistent identifier of the receiver. >+ */ >+ public long getId() { >+ return id; >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public Employee getTeamLeader() { >+ return teamLeader; >+ } >+ >+ public long getVersion() { >+ return version; >+ } >+ >+ public void setDescription(String description) { >+ this.description = description; >+ } >+ >+ /** >+ * Set the persistent identifier of the receiver. >+ */ >+ public void setId(long id) { >+ this.id = id; >+ } >+ >+ public void setName(String name) { >+ this.name = name; >+ } >+ >+ public void setTeamLeader(Employee teamLeader) { >+ this.teamLeader = teamLeader; >+ } >+ >+ public void setVersion(long version) { >+ this.version = version; >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/SmallProject.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/SmallProject.java (revision 0) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/performance/SmallProject.java (revision 0) >@@ -0,0 +1,35 @@ >+/******************************************************************************* >+ * Copyright (c) 1998, 2008 Oracle. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+ * which accompanies this distribution. >+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+ * and the Eclipse Distribution License is available at >+ * http://www.eclipse.org/org/documents/edl-v10.php. >+ * >+ * Contributors: >+ * Oracle - initial API and implementation from Oracle TopLink >+ ******************************************************************************/ >+package org.eclipse.persistence.testing.models.jpa.performance; >+ >+/** >+ * <p><b>Purpose</b>: SmallProject is a concrete subclass of Project which adds no additional attributes. >+ * <p><b>Description</b>: When the PROJ_TYPE is set to 'S' in the PROJECT table a SmallProject is instantiated. >+ * No table definition is required and the descriptor is very simple. >+ */ >+public class SmallProject extends Project { >+ >+ /** >+ * Print the SmallProject's information. >+ */ >+ public String toString() { >+ java.io.StringWriter writer = new java.io.StringWriter(); >+ >+ writer.write("Small Project: "); >+ writer.write(getName()); >+ writer.write(" "); >+ writer.write(getDescription()); >+ writer.write(""); >+ return writer.toString(); >+ } >+} >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java (working copy) >@@ -39,7 +39,6 @@ > import javax.persistence.OptimisticLockException; > import javax.persistence.RollbackException; > >-import junit.extensions.TestSetup; > import junit.framework.*; > > import org.eclipse.persistence.jpa.config.CacheUsage; >@@ -55,7 +54,6 @@ > import org.eclipse.persistence.queries.ReadAllQuery; > import org.eclipse.persistence.sequencing.NativeSequence; > import org.eclipse.persistence.sequencing.Sequence; >-import org.eclipse.persistence.tools.schemaframework.SchemaManager; > import org.eclipse.persistence.sessions.server.ReadConnectionPool; > import org.eclipse.persistence.sessions.server.ServerSession; > import org.eclipse.persistence.exceptions.ValidationException; >@@ -82,8 +80,8 @@ > */ > public class EntityManagerJUnitTestSuite extends JUnitTestCase { > >- /** The field length for the firstname */ >- public static final int MAX_FIRST_NAME_FIELD_LENGTH = 255; >+ /** The field length for the firstname */ >+ public static final int MAX_FIRST_NAME_FIELD_LENGTH = 255; > > public EntityManagerJUnitTestSuite() { > super(); >@@ -92,25 +90,151 @@ > public EntityManagerJUnitTestSuite(String name) { > super(name); > } >- >+ > public static Test suite() { >- try{ >- TestSuite suite = new TestSuite(EntityManagerJUnitTestSuite.class); >+ TestSuite suite = new TestSuite(); >+ suite.setName("EntityManagerJUnitTestSuite"); >+ >+ suite.addTest(new EntityManagerJUnitTestSuite("testSetup")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testWeaving")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClearEntityManagerWithoutPersistenceContext")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllProjects")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateUsingTempStorage")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSequenceObjectDefinition")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFindDeleteAllPersist")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testExtendedPersistenceContext")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testRemoveFlushFind")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testRemoveFlushPersistContains")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testTransactionRequired")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSubString")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFlushModeOnUpdateQuery")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testContainsRemoved")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testRefreshRemoved")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testRefreshNotManaged")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDoubleMerge")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDescriptorNamedQueryForMultipleQueries")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDescriptorNamedQuery")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClearEntityManagerWithoutPersistenceContextSimulateJTA")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMultipleEntityManagerFactories")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testOneToManyDefaultJoinTableName")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClosedEmShouldThrowException")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testRollbackOnlyOnException")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllProjectsWithNullTeamLeader")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllLargeProjectsWithNullTeamLeader")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllSmallProjectsWithNullTeamLeader")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllProjectsWithName")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllLargeProjectsWithName")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllSmallProjectsWithName")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllLargeProjects")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateAllSmallProjects")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testUpdateUsingTempStorageWithParameter")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDeleteAllLargeProjectsWithNullTeamLeader")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDeleteAllSmallProjectsWithNullTeamLeader")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDeleteAllProjectsWithNullTeamLeader")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDeleteAllPhonesWithNullOwner")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSetFieldForPropertyAccessWithNewEM")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSetFieldForPropertyAccessWithRefresh")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSetFieldForPropertyAccess")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testInitializeFieldForPropertyAccess")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCascadePersistToNonEntitySubclass")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCascadeMergeManaged")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCascadeMergeDetached")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPrimaryKeyUpdatePKFK")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPrimaryKeyUpdateSameValue")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPrimaryKeyUpdate")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testRemoveNull")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testContainsNull")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPersistNull")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMergeNull")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMergeRemovedObject")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMergeDetachedObject")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSerializedLazy")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCloneable")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testLeftJoinOneToOneQuery")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testNullifyAddressIn")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testQueryOnClosedEM")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testIncorrectBatchQueryHint")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFetchQueryHint")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testBatchQueryHint")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testQueryHints")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testParallelMultipleFactories")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMultipleFactories")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPersistenceProperties")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testBeginTransactionCloseCommitTransaction")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testBeginTransactionClose")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClose")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPersistOnNonEntity")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testWRITELock")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_UpdateAll_Refresh_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_UpdateAll_Refresh")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_UpdateAll_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_UpdateAll")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_CustomUpdate_Refresh_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_CustomUpdate_Refresh")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_CustomUpdate_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_OriginalInCache_CustomUpdate")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_UpdateAll_Refresh_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_UpdateAll_Refresh")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_UpdateAll_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_UpdateAll")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_CustomUpdate_Refresh_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_CustomUpdate_Refresh")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_CustomUpdate_Flush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testReadTransactionIsolation_CustomUpdate")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClearInTransaction")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClearWithFlush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClear")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCheckVersionOnMerge")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFindWithNullPk")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFindWithWrongTypePk")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPersistManagedNoException")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPersistManagedException")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPersistRemoved")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testREADLock")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testIgnoreRemovedObjectsOnDatabaseSync")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testIdentityOutsideTransaction")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testIdentityInsideTransaction")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDatabaseSyncNewObject")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSetRollbackOnly")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFlushModeEmCommitQueryAuto")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFlushModeEmCommit")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFlushModeEmCommitQueryCommit")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFlushModeEmAutoQueryAuto")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFlushModeEmAuto")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testFlushModeEmAutoQueryCommit")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCacheUsage")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testSequencePreallocationUsingCallbackTest")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testForceSQLExceptionFor219097")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testRefreshInvalidateDeletedObject")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClearWithFlush2")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testEMFWrapValidationException")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testEMDefaultTxType")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCloneable")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMergeNewObject")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMergeNewObject2")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMergeNewObject3_UseSequencing")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testMergeNewObject3_DontUseSequencing")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCreateEntityManagerFactory")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testCreateEntityManagerFactory2")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testPessimisticLockHintStartsTransaction")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testManyToOnePersistCascadeOnFlush")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testDiscoverNewReferencedObject")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testManagedEmployeesMassInsertUseSequencing")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testManagedEmployeesMassInsertDoNotUseSequencing")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testManagedEmployeesMassMergeUseSequencing")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testManagedEmployeesMassMergeDoNotUseSequencing")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testBulkDeleteThenMerge")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testNativeSequences")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testGetReference")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testGetReferenceUpdate")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testGetReferenceUsedInUpdate")); >+ suite.addTest(new EntityManagerJUnitTestSuite("testClassInstanceConverter")); >+ >+ return suite; >+ } > >- return new TestSetup(suite) { >- protected void setUp(){ >- SchemaManager schemaManager = new SchemaManager(JUnitTestCase.getServerSession()); >- new AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession(), schemaManager); >- } >- >- protected void tearDown() { >- clearCache(); >- } >- }; >- } catch (Throwable t){ >- t.printStackTrace(); >- return null; >- } >+ public void testSetup() { >+ new AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession()); > } > > /** >@@ -222,7 +346,6 @@ > > //Bug5955326, refresh should invalidate the shared cached object that was deleted outside of JPA. > public void testRefreshInvalidateDeletedObject(){ >- Object obj; > EntityManager em1 = createEntityManager(); > EntityManager em2 = createEntityManager(); > Address address = new Address(); >@@ -391,13 +514,7 @@ > clearCache(); > > Employee emp; >- Query query = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName like '"+firstName+"'"); >- if(queryFlushMode != null) { >- query.setFlushMode(queryFlushMode); >- } > FlushModeType emFlushModeOriginal = em.getFlushMode(); >- em.setFlushMode(emFlushMode); >- > // create a new Employee > emp = new Employee(); > emp.setFirstName(firstName); >@@ -405,6 +522,12 @@ > Employee result = null; > try{ > beginTransaction(em); >+ Query query = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName like '"+firstName+"'"); >+ if(queryFlushMode != null) { >+ query.setFlushMode(queryFlushMode); >+ } >+ emFlushModeOriginal = em.getFlushMode(); >+ em.setFlushMode(emFlushMode); > em.persist(emp); > result = (Employee) query.getSingleResult(); > } catch (javax.persistence.NoResultException ex) { >@@ -436,14 +559,14 @@ > String firstName = "testFlushModeOnUpdateQuery"; > Employee emp; > EntityManager em = createEntityManager(); >- Query readQuery = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.phoneNumbers IS EMPTY and e.firstName like '"+firstName+"'"); >- Query updateQuery = em.createQuery("UPDATE Employee e set e.salary = 100 where e.firstName like '" + firstName + "'"); >- updateQuery.setFlushMode(FlushModeType.AUTO); > emp = new Employee(); > emp.setFirstName(firstName); > try{ > try{ > beginTransaction(em); >+ Query readQuery = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.phoneNumbers IS EMPTY and e.firstName like '"+firstName+"'"); >+ Query updateQuery = em.createQuery("UPDATE Employee e set e.salary = 100 where e.firstName like '" + firstName + "'"); >+ updateQuery.setFlushMode(FlushModeType.AUTO); > em.persist(emp); > updateQuery.executeUpdate(); > Employee result = (Employee) readQuery.getSingleResult(); >@@ -484,34 +607,42 @@ > throw ex; > } > clearCache(); >- EntityManager localEm = createEntityManager(); >- localEm.getTransaction().begin(); >- List result = localEm.createQuery("SELECT e from Employee e").getResultList(); >+ em = createEntityManager(); >+ beginTransaction(em); >+ List result = em.createQuery("SELECT e FROM Employee e").getResultList(); > Employee emp = (Employee)result.get(0); > Employee emp2 = (Employee)result.get(1); > String newName = ""+System.currentTimeMillis(); > emp2.setFirstName(newName); >- localEm.flush(); >+ em.flush(); > emp2.setLastName("Whatever"); > emp2.setVersion(0); > try{ >- localEm.flush(); >+ em.flush(); > }catch (Exception ex){ >- localEm.clear(); //prevent the flush again >- String eName = (String)localEm.createQuery("SELECT e.firstName from Employee e where e.id = " + emp2.getId()).getSingleResult(); >+ em.clear(); //prevent the flush again >+ String eName = (String)em.createQuery("SELECT e.firstName FROM Employee e where e.id = " + emp2.getId()).getSingleResult(); > assertTrue("Failed to keep txn open for set RollbackOnly", eName.equals(newName)); > } > try{ >- assertTrue("Failed to mark txn rollback only", localEm.getTransaction().getRollbackOnly()); >- }finally{ >+ if (isOnServer()) { >+ assertTrue("Failed to mark txn rollback only", !isTransactionActive(em)); >+ } else { >+ assertTrue("Failed to mark txn rollback only", em.getTransaction().getRollbackOnly()); >+ } >+ } finally{ > try{ >- localEm.getTransaction().commit(); >+ commitTransaction(em); > }catch (RollbackException ex){ > return; > }catch (RuntimeException ex){ >- localEm.getTransaction().rollback(); >- throw ex; >- >+ if (ex.getCause() instanceof javax.transaction.RollbackException) { >+ return; >+ } >+ if (isTransactionActive(em)){ >+ rollbackTransaction(em); >+ } >+ throw ex; > } > } > fail("Failed to throw rollback exception"); >@@ -649,10 +780,10 @@ > > public void testIgnoreRemovedObjectsOnDatabaseSync() { > EntityManager em = createEntityManager(); >- Query phoneQuery = em.createQuery("Select p from PhoneNumber p where p.owner.lastName like 'Dow%'"); >- Query empQuery = em.createQuery("Select e from Employee e where e.lastName like 'Dow%'"); > > beginTransaction(em); >+ Query phoneQuery = em.createQuery("Select p from PhoneNumber p where p.owner.lastName like 'Dow%'"); >+ Query empQuery = em.createQuery("Select e FROM Employee e where e.lastName like 'Dow%'"); > //--setup > try{ > Employee emp = new Employee(); >@@ -725,6 +856,10 @@ > } > > public void testREADLock(){ >+ // Cannot create parallel entity managers in the server. >+ if (isOnServer()) { >+ return; >+ } > EntityManager em = createEntityManager(); > beginTransaction(em); > Employee employee = null; >@@ -1724,30 +1859,38 @@ > throw ex; > } > clearCache(); >- EntityManager localEm = createEntityManager(); >- localEm.getTransaction().begin(); >+ em = createEntityManager(); >+ beginTransaction(em); > Employee emp = null; > String originalName = ""; >- try{ >- Query query = localEm.createQuery("Select e from Employee e where e.firstName is not null"); >+ try { >+ Query query = em.createQuery("Select e FROM Employee e where e.firstName is not null"); > emp = (Employee)query.getResultList().get(0); > originalName = emp.getFirstName(); > emp.setFirstName("Bobster"); >- localEm.clear(); >- localEm.getTransaction().commit(); >- }catch (RuntimeException ex){ >- localEm.getTransaction().rollback(); >- localEm.close(); >+ em.clear(); >+ commitTransaction(em); >+ } catch (RuntimeException ex) { >+ if (isTransactionActive(em)) { >+ rollbackTransaction(em); >+ } >+ closeEntityManager(em); > throw ex; > } >- boolean cleared = !localEm.contains(emp); >- emp = localEm.find(Employee.class, emp.getId()); >- localEm.close(); >+ boolean cleared = !em.contains(emp); >+ emp = em.find(Employee.class, emp.getId()); >+ closeEntityManager(em); > assertTrue("EntityManager not properly cleared", cleared); > assertTrue("Employee was updated although EM was cleared", emp.getFirstName().equals(originalName)); > } > > public void testExtendedPersistenceContext() { >+ // Extended persistence context are not supported in the server. >+ // TODO: make this test use an extended entity manager in the server by creating from the factory and joining transaction. >+ if (isOnServer()) { >+ return; >+ } >+ > String firstName = "testExtendedPersistenceContext"; > int originalSalary = 0; > >@@ -2111,13 +2254,13 @@ > } > em.clear(); > >- Query selectQuery = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = '"+firstName+"'"); > Employee employeeUOW = null; > > int salaryNew = 100; > String lastNameNew = "New"; > > beginTransaction(em); >+ Query selectQuery = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = '"+firstName+"'"); > > try{ > if(shouldRefresh) { >@@ -2302,6 +2445,10 @@ > } > > public void testWRITELock(){ >+ // Cannot create parallel transactions. >+ if (isOnServer()) { >+ return; >+ } > EntityManager em = createEntityManager(); > Employee employee = new Employee(); > employee.setFirstName("Mark"); >@@ -2407,16 +2554,22 @@ > boolean testPass = false; > Object nonEntity = new Object(); > EntityManager em = createEntityManager(); >- >+ beginTransaction(em); > try { > em.persist(nonEntity); > } catch (IllegalArgumentException e) { > testPass = true; >+ } finally { >+ rollbackTransaction(em); > } > Assert.assertTrue(testPass); > } > > public void testClose() { >+ // Close is not used on server. >+ if (isOnServer()) { >+ return; >+ } > EntityManager em = createEntityManager(); > if(!em.isOpen()) { > fail("Created EntityManager is not open"); >@@ -2428,6 +2581,10 @@ > } > > public void testBeginTransactionClose() { >+ // Close is not used on server. >+ if (isOnServer()) { >+ return; >+ } > EntityManager em = createEntityManager(); > beginTransaction(em); > try{ >@@ -2452,6 +2609,10 @@ > } > > public void testBeginTransactionCloseCommitTransaction() { >+ // EntityManager is always open in server. >+ if (isOnServer()) { >+ return; >+ } > String firstName = "testBeginTrCloseCommitTr"; > EntityManager em = createEntityManager(); > >@@ -2533,6 +2694,11 @@ > }*/ > > public void testPersistenceProperties() { >+ // Different properties are used on the server. >+ if (isOnServer()) { >+ return; >+ } >+ > EntityManager em = createEntityManager(); > ServerSession ss = ((org.eclipse.persistence.internal.jpa.EntityManagerImpl)em).getServerSession(); > >@@ -3012,6 +3178,10 @@ > * Bug51411440: need to throw IllegalStateException if query executed on closed em > */ > public void testQueryOnClosedEM() { >+ // Server entity managers are not closed. >+ if (isOnServer()) { >+ return; >+ } > boolean exceptionWasThrown = false; > EntityManager em = createEntityManager(); > Query q = em.createQuery("SELECT e FROM Employee e "); >@@ -3094,7 +3264,7 @@ > > // test for GlassFish bug 711 - throw a descriptive exception when an uninstantiated valueholder is serialized and then accessed > public void testSerializedLazy(){ >- org.eclipse.persistence.jpa.JpaEntityManager em = (org.eclipse.persistence.jpa.JpaEntityManager) createEntityManager(); >+ EntityManager em = createEntityManager(); > > beginTransaction(em); > >@@ -3110,7 +3280,7 @@ > commitTransaction(em); > closeEntityManager(em); > clearCache(); >- em = (org.eclipse.persistence.jpa.JpaEntityManager) createEntityManager(); >+ em = createEntityManager(); > String ejbqlString = "SELECT e FROM Employee e WHERE e.firstName = 'Owen' and e.lastName = 'Hargreaves'"; > List result = em.createQuery(ejbqlString).getResultList(); > emp = (Employee)result.get(0); >@@ -3262,7 +3432,7 @@ > } > > beginTransaction(em); >- em.remove(emp); //attempt to remove the Employee >+ em.remove(em.find(Employee.class, emp.getId())); //attempt to remove the Employee > try{ > em.merge(emp); //then attempt to merge the Employee > fail("No exception thrown when merging a removed entity is attempted."); >@@ -3506,27 +3676,35 @@ > commitTransaction(em); > > beginTransaction(em); >+ emp = em.merge(emp); > emp.setId(id + 1); > > try { > commitTransaction(em); >- } catch (PersistenceException pe) { >- if (isTransactionActive(em)){ >+ } catch (Exception exception) { >+ if (isTransactionActive(em)) { > rollbackTransaction(em); > } >- >- if (pe.getCause() instanceof ValidationException) { >- ValidationException ve = (ValidationException) pe.getCause(); >+ Throwable persistenceException = exception; >+ if (exception.getCause() instanceof javax.transaction.RollbackException) { >+ // In the server this is always a rollback exception, need to get nested exception. >+ persistenceException = exception.getCause().getCause(); >+ } >+ if (!(persistenceException instanceof PersistenceException)) { >+ AssertionFailedError failure = new AssertionFailedError("Wrong exception type thrown: " + persistenceException.getClass()); >+ failure.initCause(exception); >+ throw failure; >+ } >+ if (persistenceException.getCause() instanceof ValidationException) { >+ ValidationException ve = (ValidationException) persistenceException.getCause(); > if (ve.getErrorCode() == ValidationException.PRIMARY_KEY_UPDATE_DISALLOWED) { > return; > } else { > fail("Wrong error code for ValidationException: " + ve.getErrorCode()); > } > } else { >- fail("ValiationException expected, thrown: " + pe.getCause()); >+ fail("ValiationException expected, thrown: " + persistenceException.getCause()); > } >- } catch (Exception e) { >- fail("Wrong exception type thrown: " + e.getClass()); > } finally { > closeEntityManager(em); > } >@@ -3587,23 +3765,34 @@ > > try { > commitTransaction(em); >- } catch (PersistenceException pe) { >- if (isTransactionActive(em)){ >+ } catch (Exception exception) { >+ if (isTransactionActive(em)) { > rollbackTransaction(em); > } >- >- if (pe.getCause() instanceof ValidationException) { >- ValidationException ve = (ValidationException) pe.getCause(); >+ Throwable persistenceException = exception; >+ if (exception.getCause() instanceof javax.transaction.RollbackException) { >+ // In the server this is always a rollback exception, need to get nested exception. >+ persistenceException = exception.getCause().getCause(); >+ } >+ if (!(persistenceException instanceof PersistenceException)) { >+ AssertionFailedError failure = new AssertionFailedError("Wrong exception type thrown: " + persistenceException.getClass()); >+ failure.initCause(exception); >+ throw failure; >+ } >+ if (persistenceException.getCause() instanceof ValidationException) { >+ ValidationException ve = (ValidationException) persistenceException.getCause(); > if (ve.getErrorCode() == ValidationException.PRIMARY_KEY_UPDATE_DISALLOWED) { > return; > } else { >- fail("Wrong error code for ValidationException: " + ve.getErrorCode()); >+ AssertionFailedError failure = new AssertionFailedError("Wrong error code for ValidationException: " + ve.getErrorCode()); >+ failure.initCause(ve); >+ throw failure; > } > } else { >- fail("ValiationException expected, thrown: " + pe.getCause()); >+ AssertionFailedError failure = new AssertionFailedError("ValiationException expected, thrown: " + persistenceException.getCause()); >+ failure.initCause(persistenceException); >+ throw failure; > } >- } catch (Exception e) { >- fail("Wrong exception type thrown: " + e.getClass()); > } finally { > closeEntityManager(em); > } >@@ -3811,18 +4000,20 @@ > > clearCache(); > >- employee = em.find(Employee.class, new Integer(id)); >- address = employee.getAddress(); >- >- assertTrue("The address was not persisted.", employee.getAddress() != null); >- assertTrue("The address was not correctly persisted.", employee.getAddress().getCity().equals("Shawshank")); >- >+ em = createEntityManager(); > beginTransaction(em); >- employee.setAddress((Address)null); >- em.remove(address); >- em.remove(employee); >- commitTransaction(em); >- >+ try { >+ employee = em.find(Employee.class, new Integer(id)); >+ address = employee.getAddress(); >+ >+ assertTrue("The address was not persisted.", employee.getAddress() != null); >+ assertTrue("The address was not correctly persisted.", employee.getAddress().getCity().equals("Shawshank")); >+ } finally { >+ employee.setAddress((Address)null); >+ em.remove(address); >+ em.remove(employee); >+ commitTransaction(em); >+ } > } > > /** >@@ -3866,19 +4057,22 @@ > > clearCache(); > >- employee = em.find(Employee.class, new Integer(id)); >- address = employee.getAddress(); >- >- assertTrue("The address was not persisted.", employee.getAddress() != null); >- assertTrue("The address was not correctly persisted.", employee.getAddress().getCity().equals("Metropolis")); >+ em = createEntityManager(); >+ beginTransaction(em); >+ try { >+ employee = em.find(Employee.class, new Integer(id)); >+ address = employee.getAddress(); > >- Address initialAddress = em.find(Address.class, new Integer(addressId)); >- beginTransaction(em); >- employee.setAddress((Address)null); >- em.remove(address); >- em.remove(employee); >- em.remove(initialAddress); >- commitTransaction(em); >+ assertTrue("The address was not persisted.", employee.getAddress() != null); >+ assertTrue("The address was not correctly persisted.", employee.getAddress().getCity().equals("Metropolis")); >+ } finally { >+ Address initialAddress = em.find(Address.class, new Integer(addressId)); >+ employee.setAddress((Address)null); >+ em.remove(address); >+ em.remove(employee); >+ em.remove(initialAddress); >+ commitTransaction(em); >+ } > } > > /** >@@ -3905,6 +4099,7 @@ > int addressId = address.getId(); > > beginTransaction(em); >+ employee = em.getReference(Employee.class, employee.getId()); > em.refresh(employee); > employee.getAddress(); > >@@ -3922,19 +4117,22 @@ > > clearCache(); > >- employee = em.find(Employee.class, new Integer(id)); >- address = employee.getAddress(); >- >- assertTrue("The address was not persisted.", employee.getAddress() != null); >- assertTrue("The address was not correctly persisted.", employee.getAddress().getCity().equals("Metropolis")); >+ em = createEntityManager(); >+ beginTransaction(em); >+ try { >+ employee = em.find(Employee.class, new Integer(id)); >+ address = employee.getAddress(); > >- Address initialAddress = em.find(Address.class, new Integer(addressId)); >- beginTransaction(em); >- employee.setAddress((Address)null); >- em.remove(address); >- em.remove(employee); >- em.remove(initialAddress); >- commitTransaction(em); >+ assertTrue("The address was not persisted.", employee.getAddress() != null); >+ assertTrue("The address was not correctly persisted.", employee.getAddress().getCity().equals("Metropolis")); >+ } finally { >+ Address initialAddress = em.find(Address.class, new Integer(addressId)); >+ employee.setAddress((Address)null); >+ em.remove(address); >+ em.remove(employee); >+ em.remove(initialAddress); >+ commitTransaction(em); >+ } > } > > /** >@@ -4362,8 +4560,8 @@ > try { > if(map != null) { > EntityManager em = createEntityManager(); >+ beginTransaction(em); > List projects = em.createQuery("SELECT OBJECT(p) FROM Project p").getResultList(); >- beginTransaction(em); > try { > for(int i=0; i<projects.size(); i++) { > Project p = (Project)projects.get(i); >@@ -4591,7 +4789,11 @@ > Employee emp = em.find(Employee.class, ""); > fail("IllegalArgumentException has not been thrown"); > } catch(IllegalArgumentException ex) { >- assertTrue("Transaction is not roll back only", em.getTransaction().getRollbackOnly()); >+ if (isOnServer()) { >+ assertTrue("Transaction is not roll back only", !isTransactionActive(em)); >+ } else { >+ assertTrue("Transaction is not roll back only", em.getTransaction().getRollbackOnly()); >+ } > } finally { > rollbackTransaction(em); > closeEntityManager(em); >@@ -4599,6 +4801,10 @@ > } > > public void testClosedEmShouldThrowException() { >+ // Close is not used on server. >+ if (isOnServer()) { >+ return; >+ } > EntityManager em = createEntityManager(); > closeEntityManager(em); > String errorMsg = ""; >@@ -5389,6 +5595,113 @@ > } > } > >+ /** >+ * Create a test employee. >+ */ >+ protected Employee createEmployee(String name) { >+ EntityManager em = createEntityManager(); >+ beginTransaction(em); >+ Employee employee = new Employee(); >+ employee.setFirstName(name); >+ em.persist(employee); >+ commitTransaction(em); >+ return employee; >+ } >+ >+ /** >+ * Test getReference() API. >+ */ >+ public void testGetReference() { >+ int id = createEmployee("testGetReference").getId(); >+ >+ EntityManager em = createEntityManager(); >+ beginTransaction(em); >+ Employee employee = em.getReference(Employee.class, id); >+ if (!employee.getFirstName().equals("testGetReference")) { >+ fail("getReference returned the wrong object"); >+ } >+ commitTransaction(em); >+ >+ clearCache(); >+ >+ em = createEntityManager(); >+ beginTransaction(em); >+ employee = em.getReference(Employee.class, id); >+ if (!employee.getFirstName().equals("testGetReference")) { >+ fail("getReference returned the wrong object"); >+ } >+ commitTransaction(em); >+ >+ em = createEntityManager(); >+ beginTransaction(em); >+ employee = em.find(Employee.class, id); >+ if (!employee.getFirstName().equals("testGetReference")) { >+ fail("find returned the wrong object"); >+ } >+ commitTransaction(em); >+ >+ List key = new ArrayList(); >+ key.add(id); >+ em = createEntityManager(); >+ beginTransaction(em); >+ employee = em.getReference(Employee.class, key); >+ if (!employee.getFirstName().equals("testGetReference")) { >+ fail("getReference returned the wrong object"); >+ } >+ commitTransaction(em); >+ >+ em = createEntityManager(); >+ beginTransaction(em); >+ employee = em.find(Employee.class, key); >+ if (!employee.getFirstName().equals("testGetReference")) { >+ fail("find returned the wrong object"); >+ } >+ commitTransaction(em); >+ } >+ >+ /** >+ * Test getReference() with update. >+ */ >+ public void testGetReferenceUpdate() { >+ int id = createEmployee("testGetReference").getId(); >+ >+ clearCache(); >+ >+ EntityManager em = createEntityManager(); >+ beginTransaction(em); >+ Employee employee = em.getReference(Employee.class, id); >+ employee.setFirstName("changed"); >+ commitTransaction(em); >+ >+ verifyObject(employee); >+ clearCache(); >+ verifyObject(employee); >+ } >+ >+ /** >+ * Test getReference() used in update. >+ */ >+ public void testGetReferenceUsedInUpdate() { >+ int id = createEmployee("testGetReference").getId(); >+ >+ clearCache(); >+ >+ EntityManager em = createEntityManager(); >+ beginTransaction(em); >+ Employee employee = em.getReference(Employee.class, id); >+ Employee newEmployee = new Employee(); >+ newEmployee.setFirstName("new"); >+ newEmployee.setManager(employee); >+ em.persist(newEmployee); >+ commitTransaction(em); >+ >+ verifyObject(newEmployee); >+ verifyObject(employee); >+ clearCache(); >+ verifyObject(newEmployee); >+ verifyObject(employee); >+ } >+ > public void testClassInstanceConverter(){ > EntityManager em = createEntityManager(); > beginTransaction(em); >@@ -5410,4 +5723,5 @@ > em.remove(add); > commitTransaction(em); > } >+ > } >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAComplexUpdateEmployeePerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAComplexUpdateEmployeePerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAComplexUpdateEmployeePerformanceComparisonTest.java (working copy) >@@ -14,7 +14,7 @@ > > import java.util.*; > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -32,10 +32,12 @@ > * Get an employee id. > */ > public void setup() { >- this.originalEmployee = (Employee)getSession().acquireUnitOfWork().readObject(org.eclipse.persistence.testing.models.performance.toplink.Employee.class); >+ EntityManager manager = createEntityManager(); >+ this.originalEmployee = (Employee)manager.createQuery("Select e from Employee e").getResultList().get(0); > this.originalEmployee.getAddress(); > this.originalEmployee.getPhoneNumbers().size(); > this.count = 0; >+ manager.close(); > } > > /** >@@ -44,7 +46,7 @@ > public void test() throws Exception { > EntityManager manager = createEntityManager(); > manager.getTransaction().begin(); >- Employee employee = manager.getReference(Employee.class, new Long(originalEmployee.getId())); >+ Employee employee = manager.find(Employee.class, new Long(originalEmployee.getId())); > count++; > employee.setFirstName(originalEmployee.getFirstName() + count); > employee.setLastName(originalEmployee.getLastName() + count); >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertAddressPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertAddressPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertAddressPerformanceComparisonTest.java (working copy) >@@ -13,7 +13,7 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -28,9 +28,11 @@ > * Delete all addresses. > */ > public void reset() { >- getSession().executeNonSelectingSQL("Delete from ADDRESS where STREET = 'Hastings Perf'"); >- //getSession().getIdentityMapAccessor().initializeIdentityMaps(); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(Address.class); >+ EntityManager manager = createEntityManager(); >+ manager.getTransaction().begin(); >+ manager.createQuery("Delete from Address where street = 'Hastings Perf'").executeUpdate(); >+ manager.getTransaction().commit(); >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertDeleteAddressPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertDeleteAddressPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertDeleteAddressPerformanceComparisonTest.java (working copy) >@@ -13,7 +13,7 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertDeleteEmployeePerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertDeleteEmployeePerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertDeleteEmployeePerformanceComparisonTest.java (working copy) >@@ -14,7 +14,7 @@ > > import javax.persistence.*; > import org.eclipse.persistence.internal.helper.Helper; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertEmployeePerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertEmployeePerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAInsertEmployeePerformanceComparisonTest.java (working copy) >@@ -13,8 +13,9 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >+ > import org.eclipse.persistence.internal.helper.Helper; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -29,13 +30,13 @@ > * Delete all employees. > */ > public void reset() { >- getSession().executeNonSelectingSQL("Delete from PHONE where P_NUMBER = '9991111'"); >- getSession().executeNonSelectingSQL("Delete from EMPLOYEE where F_NAME = 'NewGuy'"); >- getSession().executeNonSelectingSQL("Delete from ADDRESS where STREET = 'Hasting Perf'"); >- //getSession().getIdentityMapAccessor().initializeIdentityMaps(); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(Address.class); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(PhoneNumber.class); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(Employee.class); >+ EntityManager manager = createEntityManager(); >+ manager.getTransaction().begin(); >+ manager.createQuery("Delete from Phone where number = '9991111'").executeUpdate(); >+ manager.createQuery("Delete from Employee where firstName = 'NewGuy'").executeUpdate(); >+ manager.createQuery("Delete from Address where firstName = 'Hasting Perf'").executeUpdate(); >+ manager.getTransaction().commit(); >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertAddressPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertAddressPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertAddressPerformanceComparisonTest.java (working copy) >@@ -13,7 +13,8 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -28,9 +29,11 @@ > * Delete all addresses. > */ > public void reset() { >- getSession().executeNonSelectingSQL("Delete from ADDRESS where STREET = 'Hastings Perf'"); >- //getSession().getIdentityMapAccessor().initializeIdentityMaps(); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(Address.class); >+ EntityManager manager = createEntityManager(); >+ manager.getTransaction().begin(); >+ manager.createQuery("Delete from Address where street = 'Hastings Perf'").executeUpdate(); >+ manager.getTransaction().commit(); >+ manager.close(); > } > > /** >@@ -49,8 +52,10 @@ > manager.getTransaction().commit(); > manager.close(); > >- getSession().executeNonSelectingSQL("Delete from ADDRESS where STREET = 'Hastings Perf'"); >- //getSession().getIdentityMapAccessor().initializeIdentityMaps(); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(Address.class); >+ manager = createEntityManager(); >+ manager.getTransaction().begin(); >+ manager.createNativeQuery("Delete from ADDRESS where STREET = 'Hastings Perf'").executeUpdate(); >+ manager.getTransaction().commit(); >+ manager.close(); > } > } >\ No newline at end of file >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertEmployeePerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertEmployeePerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertEmployeePerformanceComparisonTest.java (working copy) >@@ -13,8 +13,9 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >+ > import org.eclipse.persistence.internal.helper.Helper; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -29,13 +30,13 @@ > * Delete all employees. > */ > public void reset() { >- getSession().executeNonSelectingSQL("Delete from PHONE where P_NUMBER = '9991111'"); >- getSession().executeNonSelectingSQL("Delete from EMPLOYEE where F_NAME = 'NewGuy'"); >- getSession().executeNonSelectingSQL("Delete from ADDRESS where STREET = 'Hasting Perf'"); >- //getSession().getIdentityMapAccessor().initializeIdentityMaps(); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(Address.class); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(PhoneNumber.class); >- //HibernatePerformanceComparisonModel.getSessionFactory().evict(Employee.class); >+ EntityManager manager = createEntityManager(); >+ manager.getTransaction().begin(); >+ manager.createQuery("Delete from Phone where number = '9991111'").executeUpdate(); >+ manager.createQuery("Delete from Employee where firstName = 'NewGuy'").executeUpdate(); >+ manager.createQuery("Delete from Address where firstName = 'Hasting Perf'").executeUpdate(); >+ manager.getTransaction().commit(); >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertOrMergeEmployeeWithManagementLevelsPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertOrMergeEmployeeWithManagementLevelsPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAMassInsertOrMergeEmployeeWithManagementLevelsPerformanceComparisonTest.java (working copy) >@@ -17,9 +17,8 @@ > > import javax.persistence.*; > >-import org.eclipse.persistence.internal.jpa.EntityManagerImpl; > import org.eclipse.persistence.testing.framework.*; >-import org.eclipse.persistence.testing.models.performance.Employee; >+import org.eclipse.persistence.testing.models.jpa.performance.Employee; > > /** > * This test compares the performance of inserting Employee. >@@ -136,9 +135,9 @@ > public void reset() throws Exception { > // Delete all employees > EntityManager manager = createEntityManager(); >- ((EntityManagerImpl)manager).getServerSession().executeNonSelectingSQL("Delete from EMPLOYEE where F_NAME like 'Level_%'"); >- // clear the cache - otherwise the next run will throw OptimisticLockException >- ((EntityManagerImpl)manager).getServerSession().getIdentityMapAccessor().initializeAllIdentityMaps(); >+ manager.getTransaction().begin(); >+ manager.createQuery("Delete from Employee where firstName like 'Level_%'").executeUpdate(); >+ manager.getTransaction().commit(); > manager.close(); > } > } >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceRegressionModel.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceRegressionModel.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceRegressionModel.java (working copy) >@@ -20,7 +20,7 @@ > import javax.persistence.EntityManager; > import javax.persistence.spi.PersistenceProvider; > >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.internal.helper.Helper; > import org.eclipse.persistence.testing.framework.*; > >@@ -33,10 +33,6 @@ > setDescription("Performance tests that compare JPA performance."); > } > >- public void addRequiredSystems() { >- addRequiredSystem(new EmployeeSystem()); >- } >- > public void addTests() { > addTest(getReadingTestSuite()); > addTest(getWritingTestSuite()); >@@ -120,7 +116,17 @@ > * Create/populate database. > */ > public void setup() { >- // Populate database (through TopLink). >+ setupProvider(); >+ getSession().logMessage(getExecutor().getEntityManagerFactory().getClass().toString()); >+ System.out.println(getExecutor().getEntityManagerFactory().getClass().toString()); >+ >+ // Create schema. >+ new EmployeeTableCreator().replaceTables(getDatabaseSession()); >+ >+ // Populate database. >+ EntityManager manager = getExecutor().createEntityManager(); >+ manager.getTransaction().begin(); >+ > for (int j = 0; j < 100; j++) { > Employee empInsert = new Employee(); > empInsert.setFirstName("Brendan"); >@@ -141,11 +147,11 @@ > empInsert.getAddress().setCountry("Canada"); > empInsert.addPhoneNumber(new PhoneNumber("Work Fax", "613", "2255943")); > empInsert.addPhoneNumber(new PhoneNumber("Home", "613", "2224599")); >- getDatabaseSession().insertObject(empInsert); >+ manager.persist(empInsert); > } >- setupProvider(); >- getSession().logMessage(getExecutor().getEntityManagerFactory().getClass().toString()); >- System.out.println(getExecutor().getEntityManagerFactory().getClass().toString()); >+ >+ manager.getTransaction().commit(); >+ manager.close(); > } > > /** >@@ -184,12 +190,10 @@ > */ > public TestCase buildChangeTrackingTest() { > TestCase test = new TestCase() { >- public void test() throws Exception { >- Address address = (Address)getSession().readObject(Address.class); >- long addressId = address.getId(); >+ public void test() throws Exception { > EntityManager manager = createEntityManager(); > manager.getTransaction().begin(); >- address = manager.getReference(Address.class, new Long(addressId)); >+ Address address = (Address)manager.createQuery("Select a from Address a").getResultList().get(0); > try { > Field field = Address.class.getDeclaredField("street"); > field.setAccessible(true); >@@ -199,7 +203,7 @@ > manager.close(); > } > manager = createEntityManager(); >- address = manager.getReference(Address.class, new Long(addressId)); >+ address = manager.find(Address.class, new Long(address.getId())); > if (address.getStreet().equals("Hastings")) { > throwError("Change tracking detected the change (not used?)."); > } else { >@@ -217,11 +221,9 @@ > public TestCase buildFieldAccessChangeTrackingTest() { > TestCase test = new TestCase() { > public void test() throws Exception { >- Address address = (Address)getSession().readObject(Address.class); >- long addressId = address.getId(); > EntityManager manager = createEntityManager(); > manager.getTransaction().begin(); >- address = manager.getReference(Address.class, new Long(addressId)); >+ Address address = (Address)manager.createQuery("Select a from Address a").getResultList().get(0); > try { > address.internalSetStreet("Hastings"); > } finally { >@@ -229,7 +231,7 @@ > manager.close(); > } > manager = createEntityManager(); >- address = manager.getReference(Address.class, new Long(addressId)); >+ address = manager.find(Address.class, new Long(address.getId())); > if (address.getStreet().equals("Hastings")) { > throwError("Change tracking detected the change (not used?)."); > } else { >@@ -247,11 +249,9 @@ > public TestCase buildEmployeeChangeTrackingTest() { > TestCase test = new TestCase() { > public void test() throws Exception { >- Employee employee = (Employee)getSession().readObject(Employee.class); >- long employeeId = employee.getId(); > EntityManager manager = createEntityManager(); > manager.getTransaction().begin(); >- employee = manager.getReference(Employee.class, new Long(employeeId)); >+ Employee employee = (Employee)manager.createQuery("Select e from Employee e").getResultList().get(0); > try { > Field field = Employee.class.getDeclaredField("lastName"); > field.setAccessible(true); >@@ -261,7 +261,7 @@ > manager.close(); > } > manager = createEntityManager(); >- employee = manager.getReference(Employee.class, new Long(employeeId)); >+ employee = manager.getReference(Employee.class, new Long(employee.getId())); > if (employee.getLastName().equals("Hastings")) { > throwError("Change tracking detected the change (not used?)."); > } else { >@@ -276,15 +276,12 @@ > /** > * Add a test to see if the provider is using change tracking. > */ >- @SuppressWarnings("deprecation") >- public TestCase buildDateChangeTrackingTest() { >+ public TestCase buildDateChangeTrackingTest() { > TestCase test = new TestCase() { > public void test() throws Exception { >- Employee employee = (Employee)getSession().readObject(Employee.class); >- long employeeId = employee.getId(); > EntityManager manager = createEntityManager(); > manager.getTransaction().begin(); >- employee = manager.getReference(Employee.class, new Long(employeeId)); >+ Employee employee = (Employee)manager.createQuery("Select e from Employee e").getResultList().get(0); > try { > employee.getPeriod().getStartDate().setDate(7); > } finally { >@@ -292,7 +289,7 @@ > manager.close(); > } > manager = createEntityManager(); >- employee = manager.getReference(Employee.class, new Long(employeeId)); >+ employee = manager.getReference(Employee.class, new Long(employee.getId())); > manager.refresh(employee); > if (employee.getPeriod().getStartDate().getDate() == 7) { > throwError("Change tracking detected the change (not used?)."); >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadAllEmployeeCompletelyJoinedPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadAllEmployeeCompletelyJoinedPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadAllEmployeeCompletelyJoinedPerformanceComparisonTest.java (working copy) >@@ -14,7 +14,7 @@ > > import java.util.*; > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > > /** > * This test compares the performance of read all Employee. >@@ -36,6 +36,7 @@ > Query query = manager.createQuery("Select e from Employee e join fetch e.address left join fetch e.phoneNumbers"); > query.setHint("org.hibernate.readOnly", new Boolean(isReadOnly())); > query.setHint("eclipselink.return-shared", new Boolean(isReadOnly())); >+ query.setHint("toplink.return-shared", new Boolean(isReadOnly())); > List result = query.getResultList(); > for (Iterator iterator = result.iterator(); iterator.hasNext();) { > Employee employee = (Employee)iterator.next(); >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadAllEmployeeCompletelyPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadAllEmployeeCompletelyPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadAllEmployeeCompletelyPerformanceComparisonTest.java (working copy) >@@ -14,7 +14,7 @@ > > import java.util.*; > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+import org.eclipse.persistence.testing.models.jpa.performance.*; > > /** > * This test compares the performance of read all Employee. >@@ -36,6 +36,7 @@ > Query query = manager.createQuery("Select e from Employee e"); > query.setHint("org.hibernate.readOnly", new Boolean(isReadOnly())); > query.setHint("eclipselink.return-shared", new Boolean(isReadOnly())); >+ query.setHint("toplink.return-shared", new Boolean(isReadOnly())); > List result = query.getResultList(); > for (Iterator iterator = result.iterator(); iterator.hasNext();) { > Employee employee = (Employee)iterator.next(); >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressExpressionPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressExpressionPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressExpressionPerformanceComparisonTest.java (working copy) >@@ -13,13 +13,14 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; > >+import org.eclipse.persistence.testing.models.jpa.performance.*; >+ > /** > * This test compares the performance of read object Address. > */ > public class JPAReadObjectAddressExpressionPerformanceComparisonTest extends JPAReadPerformanceComparisonTest { >- protected long addressId; >+ protected String street; > > public JPAReadObjectAddressExpressionPerformanceComparisonTest(boolean isReadOnly) { > super(isReadOnly); >@@ -28,10 +29,12 @@ > } > > /** >- * Get an address id. >+ * Get an address street. > */ > public void setup() { >- addressId = ((Address)getSession().readObject(Address.class)).getId(); >+ EntityManager manager = createEntityManager(); >+ street = ((Address)manager.createQuery("Select a from Address a").getResultList().get(0)).getStreet(); >+ manager.close(); > } > > /** >@@ -39,8 +42,8 @@ > */ > public void test() throws Exception { > EntityManager manager = createEntityManager(); >- Query query = manager.createQuery("Select a from Address a where a.city = :city"); >- query.setParameter("city", "Ottawa"); >+ Query query = manager.createQuery("Select a from Address a where a.street = :street"); >+ query.setParameter("street", street); > Address address = (Address)uniqueResult(query, manager); > manager.close(); > } >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressNamedQueryPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressNamedQueryPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressNamedQueryPerformanceComparisonTest.java (working copy) >@@ -13,25 +13,37 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** > * This test compares the performance of read object Address. > */ > public class JPAReadObjectAddressNamedQueryPerformanceComparisonTest extends PerformanceRegressionTestCase { >+ protected String street; >+ > public JPAReadObjectAddressNamedQueryPerformanceComparisonTest() { > setDescription("This test compares the performance of read object Address using a named query."); > } > > /** >+ * Get an address street. >+ */ >+ public void setup() { >+ EntityManager manager = createEntityManager(); >+ street = ((Address)manager.createQuery("Select a from Address a").getResultList().get(0)).getStreet(); >+ manager.close(); >+ } >+ >+ /** > * Read address. > */ > public void test() throws Exception { > EntityManager manager = createEntityManager(); > manager.getTransaction().begin(); >- Query query = manager.createNamedQuery("findAddressByCity"); >- query.setParameter("city", "Ottawa"); >+ Query query = manager.createNamedQuery("findAddressByStreet"); >+ query.setParameter("street", street); > Address address = (Address)query.getSingleResult(); > manager.getTransaction().commit(); > manager.close(); >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectAddressPerformanceComparisonTest.java (working copy) >@@ -13,7 +13,8 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -30,7 +31,9 @@ > * Get an address id. > */ > public void setup() { >- addressId = ((Address)getSession().readObject(Address.class)).getId(); >+ EntityManager manager = createEntityManager(); >+ addressId = ((Address)manager.createQuery("Select a from Address a").getResultList().get(0)).getId(); >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectCompletelyEmployeePerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectCompletelyEmployeePerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectCompletelyEmployeePerformanceComparisonTest.java (working copy) >@@ -13,7 +13,8 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -30,7 +31,9 @@ > * Get an employee id. > */ > public void setup() { >- employeeId = ((Employee)getSession().readObject(org.eclipse.persistence.testing.models.performance.toplink.Employee.class)).getId(); >+ EntityManager manager = createEntityManager(); >+ employeeId = ((Employee)manager.createQuery("Select e from Employee e").getResultList().get(0)).getId(); >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectEmployeePerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectEmployeePerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectEmployeePerformanceComparisonTest.java (working copy) >@@ -13,7 +13,8 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -30,7 +31,9 @@ > * Get an employee id. > */ > public void setup() { >- employeeId = ((Employee)getSession().readObject(org.eclipse.persistence.testing.models.performance.toplink.Employee.class)).getId(); >+ EntityManager manager = createEntityManager(); >+ employeeId = ((Employee)manager.createQuery("Select e from Employee e").getResultList().get(0)).getId(); >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectGetAddressPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectGetAddressPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadObjectGetAddressPerformanceComparisonTest.java (working copy) >@@ -13,7 +13,8 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -30,7 +31,9 @@ > * Get an address id. > */ > public void setup() { >- addressId = ((Address)getSession().readObject(Address.class)).getId(); >+ EntityManager manager = createEntityManager(); >+ addressId = ((Address)manager.createQuery("Select a from Address a").getResultList().get(0)).getId(); >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAReadPerformanceComparisonTest.java (working copy) >@@ -44,6 +44,7 @@ > session.getTransaction().begin(); > query.setHint("org.hibernate.readOnly", Boolean.TRUE); > query.setHint("eclipselink.return-shared", Boolean.TRUE); >+ query.setHint("toplink.return-shared", Boolean.TRUE); > result = query.getResultList(); > session.getTransaction().commit(); > } >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAUpdateAddressPerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAUpdateAddressPerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAUpdateAddressPerformanceComparisonTest.java (working copy) >@@ -13,7 +13,8 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.*; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -32,9 +33,11 @@ > * Get an address id. > */ > public void setup() { >- Address address = (Address)getSession().readObject(Address.class); >+ EntityManager manager = createEntityManager(); >+ Address address = (Address)manager.createQuery("Select a from Address a").getResultList().get(0); > addressId = address.getId(); > street = address.getStreet(); >+ manager.close(); > count = 0; > } > >@@ -44,7 +47,7 @@ > public void test() throws Exception { > EntityManager manager = createEntityManager(); > manager.getTransaction().begin(); >- Address address = manager.getReference(Address.class, new Long(this.addressId)); >+ Address address = manager.find(Address.class, new Long(this.addressId)); > count++; > address.setStreet(street + count); > manager.getTransaction().commit(); >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAUpdateEmployeePerformanceComparisonTest.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAUpdateEmployeePerformanceComparisonTest.java (revision 10919) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/performance/JPAUpdateEmployeePerformanceComparisonTest.java (working copy) >@@ -13,7 +13,8 @@ > package org.eclipse.persistence.testing.tests.jpa.performance; > > import javax.persistence.*; >-import org.eclipse.persistence.testing.models.performance.*; >+ >+import org.eclipse.persistence.testing.models.jpa.performance.Employee; > import org.eclipse.persistence.testing.framework.*; > > /** >@@ -32,10 +33,12 @@ > * Get an employee id. > */ > public void setup() { >- Employee employee = (Employee)getSession().readObject(org.eclipse.persistence.testing.models.performance.toplink.Employee.class); >+ EntityManager manager = createEntityManager(); >+ Employee employee = (Employee)manager.createQuery("Select e from Employee e").getResultList().get(0); > this.employeeId = employee.getId(); > this.firstName = employee.getFirstName(); > this.count = 0; >+ manager.close(); > } > > /** >Index: jpa/eclipselink.jpa.test/test.properties >=================================================================== >--- jpa/eclipselink.jpa.test/test.properties (revision 10919) >+++ jpa/eclipselink.jpa.test/test.properties (working copy) >@@ -2,6 +2,7 @@ > > # Link to dependencies not in SVN, assumes default location, if you store elsewhere you need to edit these. > oracle.extensions.depend.dir=../../../extension.oracle.lib.external >+toplink.jar=../../../extension.oracle.lib.external/toplink.jar > > # Set your target database properties here or give it by -Dtest.properties=file option. > >@@ -38,6 +39,12 @@ > # logging.level=finest > # logging.level=off > >+# Weaving options, switch to ignore for no weaving >+test.agent=-javaagent:${eclipselink.jar.run} >+# test.agent=-Dignore >+test.weaving=-Dignore >+# test.weaving=-DTEST_NO_WEAVING=true >+ > # Test class to be run. > test.class=org.eclipse.persistence.testing.tests.jpa.FullRegressionTestSuite > # test.class=org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite >Index: jpa/eclipselink.jpa.test/Testing Browser (JPA).launch >=================================================================== >--- jpa/eclipselink.jpa.test/Testing Browser (JPA).launch (revision 10919) >+++ jpa/eclipselink.jpa.test/Testing Browser (JPA).launch (working copy) >@@ -37,12 +37,6 @@ > <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/eclipselink.jpa.test/eclipselink-xml-only-model.jar" path="3" type="2"/> "/> > <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/eclipselink.jpa.test/eclipselink-xml-extended-model.jar" path="3" type="2"/> "/> > <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/eclipselink.jpa.test/jpa-performance.jar" path="3" type="2"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/db2java_9.zip" path="3" type="2"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/jconn3.jar" path="3" type="2"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/mysql-connector-java-5.0.7-bin.jar" path="3" type="2"/> "/> >-<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/extension.lib.external/postgresql_jdbc3_82.jar" path="3" type="2"/> "/> >- >- > <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/eclipselink.core.test/run" path="3" type="2"/> "/> > </listAttribute> > <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 218628
:
91388
| 92812