diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java index 9cd2f0e2d..41bd19012 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java @@ -1278,13 +1278,14 @@ public class MetaDataRepository Class cls; for (Iterator itr = names.iterator(); itr.hasNext();) { cls = classForName((String) itr.next(), clsLoader); - if (cls != null) + if (cls != null) { classes.add(cls); - // if the class is an interface, load its metadata to kick - // off the impl generator - if (cls.isInterface()) - getMetaData(cls, clsLoader, false); + // if the class is an interface, load its metadata to kick + // off the impl generator + if (cls.isInterface()) + getMetaData(cls, clsLoader, false); + } } return classes; } diff --git a/openjpa-persistence-jdbc/pom.xml b/openjpa-persistence-jdbc/pom.xml index 4643d63f0..c27cfa5bb 100644 --- a/openjpa-persistence-jdbc/pom.xml +++ b/openjpa-persistence-jdbc/pom.xml @@ -326,26 +326,14 @@ org/apache/openjpa/**/*.*.class + org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java + org/apache/openjpa/persistence/kernel/TestEJBEmbedded.java org/apache/openjpa/persistence/annotations/TestAdvAnnot.java - org/apache/openjpa/persistence/annotations/TestAdvAnnot.java - org/apache/openjpa/persistence/annotations/TestAnnotationBasics.java org/apache/openjpa/persistence/annotations/TestDDCallbackMethods.java org/apache/openjpa/persistence/annotations/TestEJBEmbedded.java - org/apache/openjpa/persistence/annotations/TestEmbeddableSuperclass.java - org/apache/openjpa/persistence/annotations/TestEmbeddedId.java org/apache/openjpa/persistence/annotations/TestEntityListenerAnnot.java org/apache/openjpa/persistence/annotations/TestEntityOrderBy.java - org/apache/openjpa/persistence/annotations/TestEnumerated.java - org/apache/openjpa/persistence/annotations/TestFlatInheritance.java - org/apache/openjpa/persistence/annotations/TestGenerators.java - org/apache/openjpa/persistence/annotations/TestJoinedInheritance.java - org/apache/openjpa/persistence/annotations/TestManyToMany.java - org/apache/openjpa/persistence/annotations/TestMapKey.java - org/apache/openjpa/persistence/annotations/TestOneToMany.java - org/apache/openjpa/persistence/annotations/TestOneToOne.java org/apache/openjpa/persistence/annotations/TestPropertyAccess.java - org/apache/openjpa/persistence/annotations/TestSerializedLobs.java - org/apache/openjpa/persistence/annotations/TestTablePerClassInheritance.java org/apache/openjpa/persistence/annotations/TestVersion.java org/apache/openjpa/persistence/cache/TestQueryCache.java org/apache/openjpa/persistence/conf/TestKodoConfiguration.java @@ -401,10 +389,8 @@ org/apache/openjpa/persistence/jdbc/meta/TestEJBByteArray.java org/apache/openjpa/persistence/jdbc/meta/TestEJBColumnIOMappings.java org/apache/openjpa/persistence/jdbc/meta/TestEJBConstantJoinOnSameRefTable.java - org/apache/openjpa/persistence/jdbc/meta/TestEJBCustomMapping.java org/apache/openjpa/persistence/jdbc/meta/TestEJBDateVersion.java org/apache/openjpa/persistence/jdbc/meta/TestEJBEager.java - org/apache/openjpa/persistence/jdbc/meta/TestEJBInverseOneToOne.java org/apache/openjpa/persistence/jdbc/meta/TestEJBOuterJoinValues.java org/apache/openjpa/persistence/jdbc/meta/TestIntermediate.java org/apache/openjpa/persistence/jdbc/meta/TestIrregularJoins.java @@ -432,7 +418,6 @@ org/apache/openjpa/persistence/jdbc/query/TestSQLQueries.java org/apache/openjpa/persistence/jdbc/query/TestStringFunctions.java org/apache/openjpa/persistence/jdbc/schema/TestClassDBSequenceFactory.java - org/apache/openjpa/persistence/jdbc/schema/TestClassSequenceFactory.java org/apache/openjpa/persistence/jdbc/schema/TestDBSequenceFactory.java org/apache/openjpa/persistence/jdbc/schema/TestDynamicSchemaFactory.java org/apache/openjpa/persistence/jdbc/schema/TestJDBCListener.java @@ -445,13 +430,7 @@ org/apache/openjpa/persistence/jdbc/schema/TestXMLSchemaParser.java org/apache/openjpa/persistence/jdbc/schema/TestXMLSchemaSerializer.java org/apache/openjpa/persistence/jpql/clauses/TestBulkUpdate.java - org/apache/openjpa/persistence/jpql/clauses/TestEJBClauses.java - org/apache/openjpa/persistence/jpql/clauses/TestEJBDeleteUpdateImpl.java - org/apache/openjpa/persistence/jpql/clauses/TestEJBPolymorphicQuery.java - org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java org/apache/openjpa/persistence/jpql/expressions/TestEJBQLCondExpression.java - org/apache/openjpa/persistence/jpql/functions/TestEJBQLFunction.java - org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java org/apache/openjpa/persistence/kernel/Test2EJBConcurrency.java org/apache/openjpa/persistence/kernel/TestAbstractMappedAppIdSuper.java org/apache/openjpa/persistence/kernel/TestArrayValues2.java @@ -464,11 +443,9 @@ org/apache/openjpa/persistence/kernel/TestDateQueries.java org/apache/openjpa/persistence/kernel/TestDependentFields2.java org/apache/openjpa/persistence/kernel/TestDetachedStateManager.java - org/apache/openjpa/persistence/kernel/TestEJBEmbedded.java org/apache/openjpa/persistence/kernel/TestEJBEntityManager.java org/apache/openjpa/persistence/kernel/TestEJBGetObjectByIdValue.java org/apache/openjpa/persistence/kernel/TestEJBIncrementalFlushes.java - org/apache/openjpa/persistence/kernel/TestEJBInterfaces.java org/apache/openjpa/persistence/kernel/TestEJBLobs.java org/apache/openjpa/persistence/kernel/TestEJBLocales.java org/apache/openjpa/persistence/kernel/TestEJBManagedInverses.java @@ -525,7 +502,6 @@ org/apache/openjpa/persistence/kernel/TestStateManagerImplData.java org/apache/openjpa/persistence/kernel/TestStaticInnerClasses.java org/apache/openjpa/persistence/kernel/TestStoreBlob.java - org/apache/openjpa/persistence/kernel/TestTransition2.java org/apache/openjpa/persistence/meta/TestClassMetaData.java org/apache/openjpa/persistence/meta/TestExternalValues.java org/apache/openjpa/persistence/meta/TestFieldDeclarationOrder.java @@ -535,18 +511,9 @@ org/apache/openjpa/persistence/meta/TestSequenceAssigned.java org/apache/openjpa/persistence/meta/TestValueStrategies.java org/apache/openjpa/persistence/meta/TestXMLPersistenceMetaDataSerializer.java - org/apache/openjpa/persistence/query/TestAccessPathsOfSubqueries.java - org/apache/openjpa/persistence/query/TestComplexQueries.java org/apache/openjpa/persistence/query/TestEJBDeleteUpdateImpl.java - org/apache/openjpa/persistence/query/TestEJBPolymorphicQuery.java org/apache/openjpa/persistence/query/TestEJBQueryInterface.java - org/apache/openjpa/persistence/query/TestJPAQuerySubclassFunc.java - org/apache/openjpa/persistence/query/TestMathQueries.java - org/apache/openjpa/persistence/query/TestNamedQueries.java - org/apache/openjpa/persistence/query/TestQueryExpressionSplit.java org/apache/openjpa/persistence/query/TestQueryResults.java - org/apache/openjpa/persistence/query/TestQuotedNumbersInFilters2.java - org/apache/openjpa/persistence/query/TestSimple.java diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/AnnotationTestCase.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/AnnotationTestCase.java new file mode 100644 index 000000000..991b68e3a --- /dev/null +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/AnnotationTestCase.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.annotations; + +import org.apache.openjpa.persistence.common.utils.AbstractTestCase; + +public abstract class AnnotationTestCase extends AbstractTestCase { + + public AnnotationTestCase(String name, String s) { + super(name, s); + } + + @Override + protected String computePersistenceXmlResource(String s) { + if (s.startsWith("annotation")) + return "org/apache/openjpa/persistence/annotations/common/apps/" + + "annotApp/annotype/META-INF/persistence.xml"; + else if (s.startsWith("dd")) + return "org/apache/openjpa/persistence/annotations/common/apps/" + + "annotApp/ddtype/META-INF/persistence.xml"; + else + return super.computePersistenceXmlResource(s); + } +} diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAdvAnnot.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAdvAnnot.java index 37692b10c..1c4e62286 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAdvAnnot.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAdvAnnot.java @@ -28,7 +28,7 @@ import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype. import org.apache.openjpa.persistence.common.utils.*; import org.apache.openjpa.persistence.OpenJPAEntityManager; -public class TestAdvAnnot extends AbstractTestCase +public class TestAdvAnnot extends AnnotationTestCase { public TestAdvAnnot(String name) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAnnotationBasics.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAnnotationBasics.java index d86d709a5..3637bf14c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAnnotationBasics.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestAnnotationBasics.java @@ -30,7 +30,7 @@ import org.apache.openjpa.persistence.common.utils.*; import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.*; -public class TestAnnotationBasics extends AbstractTestCase { +public class TestAnnotationBasics extends AnnotationTestCase { public TestAnnotationBasics(String name) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestDDCallbackMethods.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestDDCallbackMethods.java index aca608163..cd40573cc 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestDDCallbackMethods.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestDDCallbackMethods.java @@ -27,7 +27,7 @@ import org.apache.openjpa.persistence.common.utils.*; import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.*; import org.apache.openjpa.persistence.OpenJPAEntityManager; -public class TestDDCallbackMethods extends AbstractTestCase +public class TestDDCallbackMethods extends AnnotationTestCase { public TestDDCallbackMethods(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEJBEmbedded.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEJBEmbedded.java index 8183153e9..f8e181e7a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEJBEmbedded.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEJBEmbedded.java @@ -40,7 +40,7 @@ import junit.framework.*; * * @author Steve Kim */ -public class TestEJBEmbedded extends AbstractTestCase +public class TestEJBEmbedded extends AnnotationTestCase { public TestEJBEmbedded(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddableSuperclass.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddableSuperclass.java index bb7a96a9a..de5659851 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddableSuperclass.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddableSuperclass.java @@ -38,7 +38,7 @@ import junit.framework.*; * * @author Abe White */ -public class TestEmbeddableSuperclass extends AbstractTestCase +public class TestEmbeddableSuperclass extends AnnotationTestCase { public TestEmbeddableSuperclass(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddedId.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddedId.java index 8d3c86c41..62a2f4ff2 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddedId.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEmbeddedId.java @@ -33,7 +33,7 @@ import org.apache.openjpa.persistence.common.utils.*; * * @author Abe White */ -public class TestEmbeddedId extends AbstractTestCase +public class TestEmbeddedId extends AnnotationTestCase { public TestEmbeddedId(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityListenerAnnot.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityListenerAnnot.java index c9f5e5fda..0c153a015 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityListenerAnnot.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityListenerAnnot.java @@ -28,7 +28,7 @@ import org.apache.openjpa.persistence.common.utils.*; import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.*; import org.apache.openjpa.persistence.OpenJPAEntityManager; -public class TestEntityListenerAnnot extends AbstractTestCase +public class TestEntityListenerAnnot extends AnnotationTestCase { public TestEntityListenerAnnot(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityOrderBy.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityOrderBy.java index 80d348382..9ff69c1db 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityOrderBy.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEntityOrderBy.java @@ -34,7 +34,7 @@ import junit.framework.*; * * @author Abe White */ -public class TestEntityOrderBy extends AbstractTestCase +public class TestEntityOrderBy extends AnnotationTestCase { public TestEntityOrderBy(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEnumerated.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEnumerated.java index 7f6037a98..77e6907c0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEnumerated.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestEnumerated.java @@ -34,7 +34,7 @@ import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype. * * @author Abe White */ -public class TestEnumerated extends AbstractTestCase +public class TestEnumerated extends AnnotationTestCase { public TestEnumerated(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestFlatInheritance.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestFlatInheritance.java index 1a5156d00..e92f4a460 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestFlatInheritance.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestFlatInheritance.java @@ -32,7 +32,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; * * @author Steve Kim */ -public class TestFlatInheritance extends AbstractTestCase +public class TestFlatInheritance extends AnnotationTestCase { public TestFlatInheritance(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestGenerators.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestGenerators.java index c1b298d14..d6ed63ca9 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestGenerators.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestGenerators.java @@ -31,7 +31,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; * * @author Steve Kim */ -public class TestGenerators extends AbstractTestCase +public class TestGenerators extends AnnotationTestCase { public TestGenerators(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestJoinedInheritance.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestJoinedInheritance.java index 3ff706fab..f19cf13db 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestJoinedInheritance.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestJoinedInheritance.java @@ -32,7 +32,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; * * @author Steve Kim */ -public class TestJoinedInheritance extends AbstractTestCase +public class TestJoinedInheritance extends AnnotationTestCase { public TestJoinedInheritance(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestManyToMany.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestManyToMany.java index ef921f463..6a3d90f56 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestManyToMany.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestManyToMany.java @@ -34,7 +34,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; * * @author Steve Kim */ -public class TestManyToMany extends AbstractTestCase +public class TestManyToMany extends AnnotationTestCase { public TestManyToMany(String name) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestMapKey.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestMapKey.java index d5bd43a73..19bd76407 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestMapKey.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestMapKey.java @@ -39,7 +39,7 @@ import org.apache.openjpa.persistence.common.utils.*; * * @author Abe White */ -public class TestMapKey extends AbstractTestCase +public class TestMapKey extends AnnotationTestCase { public TestMapKey(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToMany.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToMany.java index 30ffb9774..0bee57f0b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToMany.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToMany.java @@ -34,7 +34,7 @@ import org.apache.openjpa.persistence.common.utils.*; * * @author Steve Kim */ -public class TestOneToMany extends AbstractTestCase +public class TestOneToMany extends AnnotationTestCase { public TestOneToMany(String name) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToOne.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToOne.java index 5fab47215..bbf038424 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToOne.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestOneToOne.java @@ -32,7 +32,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; * * @author Steve Kim */ -public class TestOneToOne extends AbstractTestCase +public class TestOneToOne extends AnnotationTestCase { public TestOneToOne(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestPropertyAccess.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestPropertyAccess.java index ac0db66c8..4cb2f74ac 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestPropertyAccess.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestPropertyAccess.java @@ -30,7 +30,7 @@ import org.apache.openjpa.persistence.common.utils.*; -public class TestPropertyAccess extends AbstractTestCase +public class TestPropertyAccess extends AnnotationTestCase { public TestPropertyAccess(String name) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestSerializedLobs.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestSerializedLobs.java index 83e9cd0d7..f9d672201 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestSerializedLobs.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestSerializedLobs.java @@ -39,7 +39,7 @@ import org.apache.openjpa.persistence.common.utils.*; * * @author Steve Kim */ -public class TestSerializedLobs extends AbstractTestCase +public class TestSerializedLobs extends AnnotationTestCase { public TestSerializedLobs(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestTablePerClassInheritance.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestTablePerClassInheritance.java index c57d59bbb..2d92a0585 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestTablePerClassInheritance.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestTablePerClassInheritance.java @@ -37,7 +37,7 @@ import org.apache.openjpa.persistence.common.utils.*; * * @author Abe White */ -public class TestTablePerClassInheritance extends AbstractTestCase +public class TestTablePerClassInheritance extends AnnotationTestCase { public TestTablePerClassInheritance(String name) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java index d957c9b3a..e0f003db7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java @@ -37,7 +37,7 @@ import org.apache.openjpa.persistence.OpenJPAPersistence; @author Steve Kim */ -public class TestVersion extends AbstractTestCase +public class TestVersion extends AnnotationTestCase { private Object oid; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java index 934b9083e..51e7d0a2f 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java @@ -66,8 +66,10 @@ import java.io.ObjectInputStream; import java.io.StringWriter; import java.io.PrintWriter; import java.io.PrintStream; +import java.net.URL; import javax.persistence.EntityManager; import javax.persistence.Query; +import javax.persistence.EntityManagerFactory; import javax.management.IntrospectionException; import org.apache.regexp.RESyntaxException; @@ -81,12 +83,16 @@ import org.apache.openjpa.persistence.OpenJPAPersistence; import org.apache.openjpa.conf.OpenJPAConfiguration; import org.apache.openjpa.kernel.OpenJPAStateManager; import org.apache.openjpa.kernel.BrokerFactory; -import org.apache.openjpa.kernel.Broker; -import org.apache.openjpa.kernel.jpql.JPQLParser; import org.apache.openjpa.lib.log.Log; +import org.apache.openjpa.meta.ClassMetaData; public abstract class AbstractTestCase extends PersistenceTestCase { + private String persistenceXmlResource; + private Map emfs = + new HashMap(); + private OpenJPAEntityManager currentEntityManager; + protected enum Platform { EMPRESS, HYPERSONIC, @@ -107,6 +113,21 @@ public abstract class AbstractTestCase extends PersistenceTestCase { public AbstractTestCase(String name, String s) { setName(name); + persistenceXmlResource = computePersistenceXmlResource(s); + } + + public void tearDown() throws Exception { + try { + super.tearDown(); + } finally { + for (EntityManagerFactory emf : emfs.values()) { + try { + closeEMF(emf); + } catch (Exception e) { + e.printStackTrace(); + } + } + } } public AbstractTestCase() { @@ -116,28 +137,33 @@ public abstract class AbstractTestCase extends PersistenceTestCase { setName(name); } + protected String computePersistenceXmlResource(String s) { + String resourceName = getClass().getPackage().getName() + .replaceAll("\\.", "/"); + resourceName += "/common/apps/META-INF/persistence.xml"; + URL resource = getClass().getClassLoader().getResource(resourceName); + if (resource != null) + return resourceName; + return defaultPersistenceXmlResource(); + } + + protected String defaultPersistenceXmlResource() { + return "org/apache/openjpa/persistence/" + + "common/apps/META-INF/persistence.xml"; + } + protected OpenJPAStateManager getStateManager(Object obj, - EntityManager pm) { - throw new UnsupportedOperationException(); + EntityManager em) { + return JPAFacadeHelper.toBroker(em).getStateManager(obj); } protected int deleteAll(Class type, EntityManager em) { - final boolean useDeleteByQuery = true; - - if (useDeleteByQuery) { - Broker broker = JPAFacadeHelper.toBroker(em); - org.apache.openjpa.kernel.Query query = broker.newQuery( - JPQLParser.LANG_JPQL, type, ""); - query.setCandidateType(type, true); - return (int) query.deleteAll(); - } else { - List list = OpenJPAPersistence.cast(em).createExtent(type, true) - .list(); - int size = list.size(); - for (Object o : list) - em.remove(o); - return size; - } + ClassMetaData meta = JPAFacadeHelper.getMetaData(em, type); + if (meta != null) + return em.createQuery("delete from " + meta.getTypeAlias()) + .executeUpdate(); + else + return -1; } protected int deleteAll(Class... types) { @@ -152,6 +178,8 @@ public abstract class AbstractTestCase extends PersistenceTestCase { } protected OpenJPAEntityManagerFactory getEmf(Map map) { + if (map == null) + map = new HashMap(); Collection keys = new ArrayList(); for (Object key : map.keySet()) if (key.toString().startsWith("kodo")) @@ -159,12 +187,28 @@ public abstract class AbstractTestCase extends PersistenceTestCase { if (keys.size() > 0) throw new IllegalArgumentException( "kodo-prefixed properties must be converted to openjpa. " + - "Properties: " + keys); - throw new UnsupportedOperationException(); + "Properties: " + keys); + + addProperties(map); + + OpenJPAEntityManagerFactory emf = emfs.get(map); + if (emf == null) { + emf = OpenJPAPersistence.createEntityManagerFactory( + "TestConv", persistenceXmlResource, map); + emfs.put(map, emf); + } + return emf; + } + + protected void addProperties(Map map) { + if (!map.containsKey("openjpa.jdbc.SynchronizeMappings")) + map.put("openjpa.jdbc.SynchronizeMappings", + "buildSchema(ForeignKeys=true)"); } protected OpenJPAEntityManagerFactory getEmf() { - throw new UnsupportedOperationException(); + Map m = new HashMap(); + return getEmf(m); } protected BrokerFactory getBrokerFactory() { @@ -182,7 +226,9 @@ public abstract class AbstractTestCase extends PersistenceTestCase { } protected OpenJPAEntityManager currentEntityManager() { - throw new UnsupportedOperationException(); + if (currentEntityManager == null || !currentEntityManager.isOpen()) + currentEntityManager = getEmf().createEntityManager(); + return currentEntityManager; } protected void startTx(EntityManager em) { @@ -209,6 +255,8 @@ public abstract class AbstractTestCase extends PersistenceTestCase { protected void endEm(EntityManager em) { if (em.isOpen()) em.close(); + if (em == currentEntityManager) + currentEntityManager = null; } protected Object getStackTrace(Throwable t) { @@ -216,7 +264,7 @@ public abstract class AbstractTestCase extends PersistenceTestCase { } protected OpenJPAConfiguration getConfiguration() { - throw new UnsupportedOperationException(); + return getEmf().getConfiguration(); } protected Platform getCurrentPlatform() { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/Base.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/Base.java index 59063a7d0..fb38502c1 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/Base.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/Base.java @@ -19,7 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; +@Entity public class Base implements Comparable { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1.java index 19387b45a..82ba6281e 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class BaseSub1 extends Base { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub1.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub1.java index 2f24cdc4a..3145e6a26 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub1.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub1.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class BaseSub1Sub1 extends BaseSub1 { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub2.java index b91fd2fdb..fb9fe4de4 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub1Sub2.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class BaseSub1Sub2 extends BaseSub1 { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub2.java index ac90415e5..ffb49a02b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BaseSub2.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class BaseSub2 extends Base { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BuildSchemaPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BuildSchemaPC.java index 68e742438..0072397f2 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BuildSchemaPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/BuildSchemaPC.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** *

Persistent type used in testing the mappingtool's buildSchema action.

* * @author Abe White */ +@Entity public class BuildSchemaPC { private String stringField = null; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC.java index 0a091207c..b3d32c594 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC.java @@ -19,6 +19,7 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; /** *

Persistent type using a byte[] for a primary key field. Used in @@ -26,6 +27,7 @@ import java.util.*; * * @author Abe White */ +@Entity public class ByteArrayPKPC { private byte[] pk = null; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC2.java index 8041ce714..7001ea2e7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ByteArrayPKPC2.java @@ -18,12 +18,15 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** *

Persistent type using a byte[] for a primary key field. Used in * {@link TestByteArrayAppId}.

* * @author Abe White */ +@Entity public class ByteArrayPKPC2 extends ByteArrayPKPC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC.java index 8e3515840..2f06e5e7a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC.java @@ -19,7 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; +@Entity public class ConstantJoinPC { private int pk1; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC2.java index d38f50481..7c1b90e94 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC2.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class ConstantJoinPC2 extends ConstantJoinPC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC3.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC3.java index 07a05f516..2831e01ac 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC3.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/ConstantJoinPC3.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class ConstantJoinPC3 extends ConstantJoinPC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DFGTest.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DFGTest.java index 7d8a0146e..7f8ccc056 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DFGTest.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DFGTest.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** *

Persistent type used in testing.

* * @author Abe White */ +@Entity public class DFGTest { private int dfgField; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DataStoreTripsPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DataStoreTripsPC.java index f997e1577..64072457e 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DataStoreTripsPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/DataStoreTripsPC.java @@ -29,6 +29,7 @@ import java.lang.annotation.Annotation; * * @author Abe White */ +@Entity public class DataStoreTripsPC { private int intField; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC.java index 60a9975bd..8c430adf8 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC.java @@ -19,12 +19,14 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; /** *

Class that uses eager outer joins for its collection fields.

* * @author Abe White */ +@Entity public class EagerOuterJoinPC { private String name = null; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC2.java index a3b0a3a99..f0a2ad696 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/EagerOuterJoinPC2.java @@ -19,12 +19,14 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; /** *

Helper class in eager to-many join testing.

* * @author Abe White */ +@Entity public class EagerOuterJoinPC2 { private String name = null; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HelperPC2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HelperPC2.java index 1680ddab6..ea36f4f13 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HelperPC2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HelperPC2.java @@ -34,7 +34,7 @@ public class HelperPC2 @Column(name="strngfld", length=50) private String stringField; - @Id + @Id @GeneratedValue private int id; @OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE}) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizA.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizA.java index 9c9ee58e1..18add00af 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizA.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizA.java @@ -20,8 +20,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; import java.io.*; +import javax.persistence.Entity; - +@Entity public abstract class HorizA implements Serializable { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalA.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalA.java index 91bc91cbf..445f9c1d0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalA.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalA.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizAppInterVerticalA implements HorizInterA { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalB.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalB.java index bc7599223..36c19c57f 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalB.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalB.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizAppInterVerticalB extends HorizAppInterVerticalA implements HorizInterB { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalC.java index a391175c5..530fa6cbd 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalC.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizAppInterVerticalC extends HorizAppInterVerticalB implements HorizInterC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalD.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalD.java index a5a434527..b906cc399 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalD.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppInterVerticalD.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizAppInterVerticalD extends HorizAppInterVerticalB implements HorizInterD { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiA.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiA.java index 7fd21849e..f1740432d 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiA.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiA.java @@ -21,9 +21,11 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.io.*; import java.util.*; +import javax.persistence.Entity; import serp.util.*; +@Entity public class HorizAppMultiA implements HorizAppA { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiB.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiB.java index 3add38697..61066926e 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiB.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiB.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizAppMultiB extends HorizAppMultiA implements HorizAppB { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiC.java index 75688e229..ad9d13f0b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiC.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizAppMultiC extends HorizAppMultiA implements HorizAppC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiD.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiD.java index 04674f90a..0f5f4ce43 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiD.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppMultiD.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizAppMultiD extends HorizAppMultiA implements HorizAppD { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleA.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleA.java index e5cee3678..cd5b2986c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleA.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleA.java @@ -21,9 +21,11 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.io.*; import java.util.*; +import javax.persistence.Entity; import serp.util.*; +@Entity public class HorizAppSingleA implements HorizAppA { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleB.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleB.java index f3b0c7c2a..4f6a2b030 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleB.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleB.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizAppSingleB extends HorizAppSingleA implements HorizAppB { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleC.java index b90cc4520..a276362c4 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleC.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizAppSingleC extends HorizAppSingleA implements HorizAppC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleD.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleD.java index 128a09006..191bac0e0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleD.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizAppSingleD.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizAppSingleD extends HorizAppSingleA implements HorizAppD { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizB.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizB.java index 8710d69a6..b96fee327 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizB.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizB.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizB extends HorizA { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizC.java index fbb83eee2..05ca34764 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizC.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public abstract class HorizC extends HorizA { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizD.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizD.java index 141a1f635..125b62459 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizD.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizD.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizD extends HorizC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizE.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizE.java index 7563854a2..0bef9f262 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizE.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizE.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizE extends HorizC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizF.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizF.java index 28cb25405..2f46d9af5 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizF.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizF.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizF extends HorizE { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizG.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizG.java index 4b764e5ad..098d09f6b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizG.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizG.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizG extends HorizE { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizH.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizH.java index 7e9a6cca3..a84b51df5 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizH.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizH.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizH extends HorizG { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizI.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizI.java index c19cf2cbd..106a14e2d 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizI.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizI.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizI extends HorizG { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatA.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatA.java index 0a4aecdf5..0dc40495c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatA.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatA.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterFlatA implements HorizInterA { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatB.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatB.java index fb190e639..f16ff92c7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatB.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatB.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterFlatB extends HorizInterFlatA implements HorizInterB { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatC.java index d12c6c1e9..b57127754 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatC.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterFlatC extends HorizInterFlatB implements HorizInterC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatD.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatD.java index c06bc7f9a..fa65f0add 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatD.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterFlatD.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterFlatD extends HorizInterFlatB implements HorizInterD { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalA.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalA.java index bef9844e1..a14ad396a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalA.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalA.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterVerticalA implements HorizInterA { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalB.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalB.java index a844d326f..fc8d5a441 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalB.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalB.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterVerticalB extends HorizInterVerticalA implements HorizInterB { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalC.java index 8e02f3628..82db8c9ff 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalC.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterVerticalC extends HorizInterVerticalB implements HorizInterC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalD.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalD.java index 714fd09ea..cf96d22aa 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalD.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizInterVerticalD.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Interface for intermediate horizontal mappings with flat mappings. * * @author Marc Prud'hommeaux */ +@Entity public class HorizInterVerticalD extends HorizInterVerticalB implements HorizInterD { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizJ.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizJ.java index bdb3f6223..fc669302a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizJ.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizJ.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizJ extends HorizD { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizK.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizK.java index 12965567c..a12121c68 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizK.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizK.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizK extends HorizJ { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizL.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizL.java index 166f1d4ed..706641a71 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizL.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizL.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizL extends HorizJ { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizM.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizM.java index 243501ec6..a4300cfb9 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizM.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizM.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizM extends HorizL { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizN.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizN.java index caa4e42cf..2652d361c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizN.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizN.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizN extends HorizM { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizO.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizO.java index 7e2557da3..722cc9774 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizO.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizO.java @@ -19,8 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; - +@Entity public class HorizO extends HorizN { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java index abbca101b..056a90a84 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java @@ -21,6 +21,7 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.io.*; import java.util.*; +import javax.persistence.Entity; import org.apache.commons.collections.*; @@ -30,6 +31,7 @@ import org.apache.commons.collections.*; * * @author Marc Prud'hommeaux */ +@Entity public class HorizRelation implements Serializable { /////////////////////// diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/InverseKeyMapPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/InverseKeyMapPC.java index d6a45145d..466bbf760 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/InverseKeyMapPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/InverseKeyMapPC.java @@ -19,7 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; +@Entity public class InverseKeyMapPC implements MappedByMapPC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBase.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBase.java index fcb63a4bf..1eb40735e 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBase.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBase.java @@ -19,7 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; +@Entity public class JoinSubclassBase implements Comparable { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubFlat.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubFlat.java index e4f055337..d78aae290 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubFlat.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubFlat.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class JoinSubclassBaseSubFlat extends JoinSubclassBaseSubVert { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubVert.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubVert.java index 6f062d597..618a86415 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubVert.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinSubclassBaseSubVert.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class JoinSubclassBaseSubVert extends JoinSubclassBase { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinTableMapPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinTableMapPC.java index 5c37061c7..53abbf323 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinTableMapPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/JoinTableMapPC.java @@ -19,7 +19,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; +@Entity public class JoinTableMapPC implements MappedByMapPC { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSCompoundPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSCompoundPC.java index aa10085b1..2c6bf653d 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSCompoundPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSCompoundPC.java @@ -19,12 +19,14 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; /** *

Persistent type with a compound primary key and LRS fields.

* * @author Abe White */ +@Entity public class LRSCompoundPC implements LRSPCIntf { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSPC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSPC.java index c7ae81076..982cc2a9c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSPC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LRSPC.java @@ -19,12 +19,14 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; +import javax.persistence.Entity; /** *

Persistent type with LRS fields.

* * @author Abe White */ +@Entity public class LRSPC implements LRSPCIntf { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LocatorTestObject.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LocatorTestObject.java index c9a69f13c..38b39994b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LocatorTestObject.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LocatorTestObject.java @@ -18,9 +18,12 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** * Used in testing; should be enhanced. */ +@Entity public class LocatorTestObject { private byte[] bytes; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LockGroupSubclass.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LockGroupSubclass.java index bbcd2e194..f9f59004d 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LockGroupSubclass.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/LockGroupSubclass.java @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + +@Entity public class LockGroupSubclass extends HorizB { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest1.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest1.java index 10baacf86..08322bcec 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest1.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest1.java @@ -20,13 +20,14 @@ package org.apache.openjpa.persistence.jdbc.common.apps; import java.util.*; - +import javax.persistence.Entity; /** *

Persistent type used for testing.

* * @author Abe White */ +@Entity public class MappingTest1 { private int value = 0; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest2.java index 339d9fa9a..30cd9e532 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest2.java @@ -28,6 +28,7 @@ import javax.persistence.*; * @author Abe White */ +@Entity public class MappingTest2 { private int pk1 = 0; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest3.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest3.java index fb44c154b..77d0ae43c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest3.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest3.java @@ -18,12 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; /** *

Persistent type used in testing.

* * @author Abe White */ +@Entity public class MappingTest3 extends MappingTest1 { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest4.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest4.java index c57d14d4b..0724249c5 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest4.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest4.java @@ -18,12 +18,15 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; /** *

Persistent type used in testing.

* * @author Abe White */ +@Entity + public class MappingTest4 extends MappingTest3 { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest5.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest5.java index cef08fd0b..2333fa539 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest5.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/MappingTest5.java @@ -18,11 +18,14 @@ */ package org.apache.openjpa.persistence.jdbc.common.apps; +import javax.persistence.Entity; + /** *

Persistent type used in testing.

* * @author Abe White */ +@Entity public class MappingTest5 extends MappingTest2 { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/BaseJDBCTest.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/BaseJDBCTest.java index 810a7fd9a..210e84606 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/BaseJDBCTest.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/BaseJDBCTest.java @@ -68,6 +68,12 @@ public class BaseJDBCTest extends org.apache.openjpa.persistence.common.utils.Ab { super(name, "jdbccactusapp"); } + + @Override + protected String defaultPersistenceXmlResource() { + return "org/apache/openjpa/persistence/jdbc/common" + + "/apps/META-INF/persistence.xml"; + } protected OpenJPAEntityManager getPM() { return (OpenJPAEntityManager)currentEntityManager(); @@ -136,10 +142,6 @@ public class BaseJDBCTest extends org.apache.openjpa.persistence.common.utils.Ab return id; } - protected OpenJPAStateManager getStateManager(Object obj,OpenJPAEntityManager pm) { - return getStateManager(obj,pm); - } - protected Properties getProperties() { return getProperties(null); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestEagerDistinct.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestEagerDistinct.java index 9f440e4ea..05405fd53 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestEagerDistinct.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestEagerDistinct.java @@ -76,10 +76,10 @@ public class TestEagerDistinct extends org.apache.openjpa.persistence.jdbc.kerne pc2.getHelperCollection().add(new HelperPC()); OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager(); - startTx(pm);; + startTx(pm); pm.persist(pc1); pm.persist(pc2); - endTx(pm);; + endTx(pm); // to make sure subclasses are selected, etc //FIXME jthomas diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEJBQLCondExpression.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEJBQLCondExpression.java index f41a70309..9b1fa80d7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEJBQLCondExpression.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEJBQLCondExpression.java @@ -23,6 +23,7 @@ import javax.persistence.EntityManager; import org.apache.openjpa.persistence.common.apps.*; import org.apache.openjpa.persistence.common.utils.AbstractTestCase; +import org.apache.openjpa.persistence.InvalidStateException; public class TestEJBQLCondExpression extends AbstractTestCase { @@ -281,7 +282,7 @@ public class TestEJBQLCondExpression extends AbstractTestCase { EntityManager em = currentEntityManager(); String query = - "SELECT NEW persistence.common.apps.MaleUser(c.name, c.computerName, c.address, c.age, c.userid)" + + "SELECT NEW org.apache.openjpa.persistence.common.apps.MaleUser(c.name, c.computerName, c.address, c.age, c.userid)" + " FROM CompUser c WHERE c.name = 'Seetha'"; MaleUser male = (MaleUser) em.createQuery(query).getSingleResult(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/BaseQueryTest.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/BaseQueryTest.java index aa724176c..350ed33f8 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/BaseQueryTest.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/BaseQueryTest.java @@ -55,11 +55,11 @@ public abstract class BaseQueryTest extends org.apache.openjpa.persistence.commo super(name, "querycactusapp"); } - protected OpenJPAEntityManager getPM() { + protected OpenJPAEntityManager getEM() { return (OpenJPAEntityManager) currentEntityManager(); } - protected OpenJPAEntityManager getPM(boolean optimistic, + protected OpenJPAEntityManager getEM(boolean optimistic, boolean retainValues) { OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestComplexQueries.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestComplexQueries.java index a2060a558..a935b8bcf 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestComplexQueries.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestComplexQueries.java @@ -289,134 +289,4 @@ public class TestComplexQueries extends BaseQueryTest { "f.stringF = \'testfXXX\'", ComplexG.class); } - - public void testRelationsIgnoreCache() { - try { - relationsIgnoreCacheTest(); - } catch (AssertionFailedError afe) { - bug(631, afe, "IgnoreCache=false queries do not detect " - + "all relationship changed"); - } - } - - public void relationsIgnoreCacheTest() { - OpenJPAEntityManager pm; - ComplexC c = new ComplexC(); - ComplexB b = new ComplexB(); - ComplexA a = new ComplexA(); - - c.setB(b); - b.setA(a); - - a.setStringA("Foo"); - pm = getPM(); - startTx(pm); - pm.persist(c); - endTx(pm); - - assertSize(1, - getPM().createNativeQuery("b.a.stringA = \'Foo\'", ComplexC.class)); - assertSize(0, getPM().createNativeQuery("b.a.stringA = \'FooX\'", - ComplexC.class)); - - pm = getPM(); - startTx(pm); - ComplexA pca = (ComplexA) pm.createExtent(ComplexA.class, false) - .iterator().next(); - ComplexB pcb = (ComplexB) pm.createExtent(ComplexB.class, false) - .iterator().next(); - ComplexC pcc = (ComplexC) pm.createExtent(ComplexC.class, false) - .iterator().next(); - - pcc.getB().getA().setStringA("Foo2"); // change the value for - - final OpenJPAQuery q; - - q = pm.createNativeQuery("b.a.stringA = \'Foo\'", ComplexC.class); - //FIXME jthomas - //q.setIgnoreCache(true); - assertEquals(1, q.getMaxResults()); - - //FIXME jthomas - //q.setIgnoreCache(false); - assertEquals(0, q.getMaxResults()); - - // now see if the ignore cache change picks up the current object - //FIXME jthomas - //q.setFilter("b.a.stringA = \'Foo2\'"); - //q.setIgnoreCache(false); - assertEquals(1, q.getMaxResults()); - - /* - Query query = pm.newQuery (C.class, "b.a = param"); - query.declareParameters ("A param"); - - query.setIgnoreCache (true); - assertSize (1, query.execute (pca)); - - query.setIgnoreCache (false); - assertSize (1, query.execute (pca)); - - // now change the instance of b.a and see if we fail (as expected) - pcb.setA (new A ()); - - query.setIgnoreCache (true); - assertSize (1, query.execute (pca)); - - query.setIgnoreCache (false); - // the bug is that the following line will fail: 1 object is returned - assertSize (0, query.execute (pca)); - */ - - final OpenJPAQuery q2; - - q2 = pm.createNativeQuery("b.a = param", ComplexC.class); - //FIXME jthomas - /* - q2.declareParameters("ComplexA param"); - - q2.setIgnoreCache(true); - assertSize(1, q2.execute(pca)); - - q2.setIgnoreCache(false); - assertSize(1, q2.execute(pca)); - - // now change the instance of b.a to null and see if we fail - pcb.setA(null); - q2.setIgnoreCache(true); - assertSize(1, q2.execute(pca)); - q2.setIgnoreCache(false); - assertSize(0, q2.execute(pca)); - - int fbq = ((FetchPlan) q2.getFetchPlan()). - getFlushBeforeQueries(); - boolean isFlushing = - fbq = FetchPlanImpl.FLUSH_TRUEOR - (fbq = FetchPlanImpl.FLUSH_WITH_CONNECTION AND - KodoJDOHelper.toBroker(pm).hasConnection()); - - // now change the instance of b.a and see if we fail (as expected) - pcb.setA(new ComplexA()); - q2.setIgnoreCache(true); - if (isFlushing) - assertSize(0, q2.execute(pca)); // we've already flushed earlier - else - assertSize(1, q2.execute(pca)); - q2.setIgnoreCache(false); - assertSize(0, q2.execute(pca)); - - // now change the instance of b.a back to the orig value - pcb.setA(pca); - q2.setIgnoreCache(true); - if (isFlushing) - assertSize(0, q2.execute(pca)); // we've already flushed earlier - else - assertSize(1, q2.execute(pca)); - q2.setIgnoreCache(false); - assertSize(1, q2.execute(pca)); - - endTx(pm); - */ - } - } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJPAQuerySubclassFunc.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJPAQuerySubclassFunc.java index ab9a43db3..9f545dc1b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJPAQuerySubclassFunc.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJPAQuerySubclassFunc.java @@ -35,7 +35,7 @@ public class TestJPAQuerySubclassFunc extends BaseQueryTest { public void setUp() { deleteAll(RuntimeTest1.class); - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); startTx(pm); pm.persist(new RuntimeTest1("TestQueryResults1", 10)); @@ -51,7 +51,7 @@ public class TestJPAQuerySubclassFunc extends BaseQueryTest { } public void testSubClassIsTrueFunction() { - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); startTx(pm); OpenJPAQuery query = @@ -70,7 +70,7 @@ public class TestJPAQuerySubclassFunc extends BaseQueryTest { } public void testSubClassIsFalseFunction() { - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); startTx(pm); OpenJPAQuery query = diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestMathQueries.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestMathQueries.java index 39b2f84a1..0eadbb560 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestMathQueries.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestMathQueries.java @@ -46,7 +46,7 @@ public class TestMathQueries extends BaseQueryTest { public void setUp() { deleteAll(QueryTest1.class); - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); startTx(pm); for (int i = 0; i <= 100; i++) { @@ -69,9 +69,9 @@ public class TestMathQueries extends BaseQueryTest { try { OpenJPAQuery q1, q2; - q1 = getPM().createQuery( + q1 = getEM().createQuery( "SELECT q FROM QueryTest1 q WHERE q.numb * q.numb = 25"); - q2 = getPM().createQuery( + q2 = getEM().createQuery( "SELECT q FROM QueryTest1 q WHERE q.numb * q.numb > 25"); assertSize(95, q2.getResultList()); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java index 979009450..0b1263393 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestNamedQueries.java @@ -50,7 +50,7 @@ public class TestNamedQueries extends BaseQueryTest { public void setUp() { deleteAll(QueryTest1.class); - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); startTx(pm); QueryTest1 pc = null; for (int i = 0; i < 10; i++) { @@ -66,7 +66,7 @@ public class TestNamedQueries extends BaseQueryTest { } public void testNamedClassQuery() { - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); OpenJPAQuery query = pm.createQuery("SELECT o FROM QueryTest1 o"); query.setResultClass(QueryTest1.class); @@ -93,7 +93,7 @@ public class TestNamedQueries extends BaseQueryTest { } public void testNamespace() { - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); OpenJPAQuery query = (OpenJPAQuery) pm.createNamedQuery("named"); assertEquals("SELECT o FROM QueryTest1 o", query.getQueryString()); query.closeAll(); @@ -102,7 +102,7 @@ public class TestNamedQueries extends BaseQueryTest { public void testSystemJDOQL() { // make sure local query metadata is parsed - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); OpenJPAQuery query = (OpenJPAQuery) pm.createNamedQuery("named"); assertEquals("SELECT o FROM QueryTest1 o", query.getQueryString()); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryExpressionSplit.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryExpressionSplit.java index f2526f4e4..c9471a784 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryExpressionSplit.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryExpressionSplit.java @@ -48,7 +48,7 @@ public class TestQueryExpressionSplit extends BaseQueryTest { assertEquals(new String[]{ "foo() bar(boo)" }, Filters.splitExpressions("foo() bar(boo)", ',', 3)); assertEquals(new String[]{ "foo() bar(boo)", "biz()", "baz(boo)" }, - Filters.splitExpressions("foo() bar(boo), bizbaz(boo)", + Filters.splitExpressions("foo() bar(boo), biz(), baz(boo)", ',', 3)); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQuotedNumbersInFilters2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQuotedNumbersInFilters2.java index dc3546c37..4b151e446 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQuotedNumbersInFilters2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQuotedNumbersInFilters2.java @@ -44,7 +44,7 @@ public class TestQuotedNumbersInFilters2 extends BaseQueryTest { public void setUp() { deleteAll(RuntimeTest1.class); - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); startTx(pm); pm.persist(new RuntimeTest1("foo", 3)); pm.persist(new RuntimeTest1("bar", 15)); @@ -140,7 +140,7 @@ public class TestQuotedNumbersInFilters2 extends BaseQueryTest { * queries. */ private long helper(String filter, boolean shouldFail) { - OpenJPAEntityManager pm = getPM(); + OpenJPAEntityManager pm = getEM(); OpenJPAQuery q = pm.createQuery("SELECT r FROM RuntimeTest1 r WHERE r." + filter); diff --git a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml index 23b474f8d..f60e41833 100644 --- a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml +++ b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/common/apps/META-INF/persistence.xml @@ -20,22 +20,22 @@ http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> org.apache.openjpa.persistence.PersistenceProviderImpl - persistence.common.apps.Entity1 - persistence.common.apps.Entity2 - persistence.common.apps.RuntimeTest1 - persistence.common.apps.RuntimeTest2 - persistence.common.apps.Course - persistence.common.apps.Department - persistence.common.apps.Student - persistence.common.apps.ArtCourse - persistence.common.apps.ScienceCourse - persistence.common.apps.EmbeddedOwnerPC - persistence.common.apps.EmbeddedPC - persistence.common.apps.ComplexEmbeddedPC - persistence.common.apps.CompUser - persistence.common.apps.MaleUser - persistence.common.apps.Address - persistence.common.apps.FemaleUser + org.apache.openjpa.persistence.common.apps.Entity1 + org.apache.openjpa.persistence.common.apps.Entity2 + org.apache.openjpa.persistence.common.apps.RuntimeTest1 + org.apache.openjpa.persistence.common.apps.RuntimeTest2 + org.apache.openjpa.persistence.common.apps.Course + org.apache.openjpa.persistence.common.apps.Department + org.apache.openjpa.persistence.common.apps.Student + org.apache.openjpa.persistence.common.apps.ArtCourse + org.apache.openjpa.persistence.common.apps.ScienceCourse + org.apache.openjpa.persistence.common.apps.EmbeddedOwnerPC + org.apache.openjpa.persistence.common.apps.EmbeddedPC + org.apache.openjpa.persistence.common.apps.ComplexEmbeddedPC + org.apache.openjpa.persistence.common.apps.CompUser + org.apache.openjpa.persistence.common.apps.MaleUser + org.apache.openjpa.persistence.common.apps.Address + org.apache.openjpa.persistence.common.apps.FemaleUser diff --git a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/common/apps/META-INF/persistence.xml b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/common/apps/META-INF/persistence.xml index 4ce71126b..5193f54e5 100644 --- a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/common/apps/META-INF/persistence.xml +++ b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/common/apps/META-INF/persistence.xml @@ -30,6 +30,7 @@ org.apache.openjpa.persistence.jdbc.common.apps.ConstantJoinPC4 org.apache.openjpa.persistence.jdbc.common.apps.ConstantJoinPC5 org.apache.openjpa.persistence.jdbc.common.apps.CustomMappingPC + org.apache.openjpa.persistence.jdbc.common.apps.DFGTest org.apache.openjpa.persistence.jdbc.common.apps.EagerPC org.apache.openjpa.persistence.jdbc.common.apps.EagerPCSub org.apache.openjpa.persistence.jdbc.common.apps.HelperPC @@ -37,6 +38,6 @@ org.apache.openjpa.persistence.jdbc.common.apps.HelperPC3 org.apache.openjpa.persistence.jdbc.common.apps.HelperPC4 org.apache.openjpa.persistence.jdbc.common.apps.InvertA - org.apache.openjpa.persistence.jdbc.common.apps.InvertB + org.apache.openjpa.persistence.jdbc.common.apps.InvertB diff --git a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/query/common/apps/META-INF/persistence.xml b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/query/common/apps/META-INF/persistence.xml index 72c66c771..06b01c47b 100644 --- a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/query/common/apps/META-INF/persistence.xml +++ b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/query/common/apps/META-INF/persistence.xml @@ -20,7 +20,8 @@ http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> org.apache.openjpa.persistence.PersistenceProviderImpl - org.apache.openjpa.persistence.query.common.apps.Entity2 + org.apache.openjpa.persistence.query.common.apps.Entity1 + org.apache.openjpa.persistence.query.common.apps.Entity2 org.apache.openjpa.persistence.query.common.apps.RuntimeTest1 org.apache.openjpa.persistence.query.common.apps.RuntimeTest2 org.apache.openjpa.persistence.query.common.apps.RuntimeTest3