mirror of https://github.com/apache/openjpa.git
Enable some of the new tests.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@628233 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4ab1384b43
commit
7d44e7a355
|
@ -1278,13 +1278,14 @@ public class MetaDataRepository
|
||||||
Class cls;
|
Class cls;
|
||||||
for (Iterator itr = names.iterator(); itr.hasNext();) {
|
for (Iterator itr = names.iterator(); itr.hasNext();) {
|
||||||
cls = classForName((String) itr.next(), clsLoader);
|
cls = classForName((String) itr.next(), clsLoader);
|
||||||
if (cls != null)
|
if (cls != null) {
|
||||||
classes.add(cls);
|
classes.add(cls);
|
||||||
|
|
||||||
// if the class is an interface, load its metadata to kick
|
// if the class is an interface, load its metadata to kick
|
||||||
// off the impl generator
|
// off the impl generator
|
||||||
if (cls.isInterface())
|
if (cls.isInterface())
|
||||||
getMetaData(cls, clsLoader, false);
|
getMetaData(cls, clsLoader, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return classes;
|
return classes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -326,26 +326,14 @@
|
||||||
<exclude>org/apache/openjpa/**/*.*.class</exclude>
|
<exclude>org/apache/openjpa/**/*.*.class</exclude>
|
||||||
|
|
||||||
<!-- exclude new tests that aren't passing yet -->
|
<!-- exclude new tests that aren't passing yet -->
|
||||||
|
<exclude>org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java</exclude>
|
||||||
|
<exclude>org/apache/openjpa/persistence/kernel/TestEJBEmbedded.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestAdvAnnot.java</exclude>
|
<exclude>org/apache/openjpa/persistence/annotations/TestAdvAnnot.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestAdvAnnot.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestAnnotationBasics.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestDDCallbackMethods.java</exclude>
|
<exclude>org/apache/openjpa/persistence/annotations/TestDDCallbackMethods.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestEJBEmbedded.java</exclude>
|
<exclude>org/apache/openjpa/persistence/annotations/TestEJBEmbedded.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestEmbeddableSuperclass.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestEmbeddedId.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestEntityListenerAnnot.java</exclude>
|
<exclude>org/apache/openjpa/persistence/annotations/TestEntityListenerAnnot.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestEntityOrderBy.java</exclude>
|
<exclude>org/apache/openjpa/persistence/annotations/TestEntityOrderBy.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestEnumerated.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestFlatInheritance.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestGenerators.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestJoinedInheritance.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestManyToMany.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestMapKey.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestOneToMany.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestOneToOne.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestPropertyAccess.java</exclude>
|
<exclude>org/apache/openjpa/persistence/annotations/TestPropertyAccess.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestSerializedLobs.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestTablePerClassInheritance.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/annotations/TestVersion.java</exclude>
|
<exclude>org/apache/openjpa/persistence/annotations/TestVersion.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/cache/TestQueryCache.java</exclude>
|
<exclude>org/apache/openjpa/persistence/cache/TestQueryCache.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/conf/TestKodoConfiguration.java</exclude>
|
<exclude>org/apache/openjpa/persistence/conf/TestKodoConfiguration.java</exclude>
|
||||||
|
@ -401,10 +389,8 @@
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBByteArray.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBByteArray.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBColumnIOMappings.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBColumnIOMappings.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBConstantJoinOnSameRefTable.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBConstantJoinOnSameRefTable.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBCustomMapping.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBDateVersion.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBDateVersion.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBEager.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBEager.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBInverseOneToOne.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBOuterJoinValues.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestEJBOuterJoinValues.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestIntermediate.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestIntermediate.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestIrregularJoins.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/meta/TestIrregularJoins.java</exclude>
|
||||||
|
@ -432,7 +418,6 @@
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/query/TestSQLQueries.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/query/TestSQLQueries.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/query/TestStringFunctions.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/query/TestStringFunctions.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestClassDBSequenceFactory.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestClassDBSequenceFactory.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestClassSequenceFactory.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestDBSequenceFactory.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestDBSequenceFactory.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestDynamicSchemaFactory.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestDynamicSchemaFactory.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestJDBCListener.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestJDBCListener.java</exclude>
|
||||||
|
@ -445,13 +430,7 @@
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestXMLSchemaParser.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestXMLSchemaParser.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestXMLSchemaSerializer.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jdbc/schema/TestXMLSchemaSerializer.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/clauses/TestBulkUpdate.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jpql/clauses/TestBulkUpdate.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/clauses/TestEJBClauses.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/clauses/TestEJBDeleteUpdateImpl.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/clauses/TestEJBPolymorphicQuery.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/expressions/TestEJBQLCondExpression.java</exclude>
|
<exclude>org/apache/openjpa/persistence/jpql/expressions/TestEJBQLCondExpression.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/functions/TestEJBQLFunction.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/jpql/joins/TestEJBJoins.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/Test2EJBConcurrency.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/Test2EJBConcurrency.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestAbstractMappedAppIdSuper.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestAbstractMappedAppIdSuper.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestArrayValues2.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestArrayValues2.java</exclude>
|
||||||
|
@ -464,11 +443,9 @@
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestDateQueries.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestDateQueries.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestDependentFields2.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestDependentFields2.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestDetachedStateManager.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestDetachedStateManager.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBEmbedded.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBEntityManager.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestEJBEntityManager.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBGetObjectByIdValue.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestEJBGetObjectByIdValue.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBIncrementalFlushes.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestEJBIncrementalFlushes.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBInterfaces.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBLobs.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestEJBLobs.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBLocales.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestEJBLocales.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestEJBManagedInverses.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestEJBManagedInverses.java</exclude>
|
||||||
|
@ -525,7 +502,6 @@
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestStateManagerImplData.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestStateManagerImplData.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestStaticInnerClasses.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestStaticInnerClasses.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestStoreBlob.java</exclude>
|
<exclude>org/apache/openjpa/persistence/kernel/TestStoreBlob.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/kernel/TestTransition2.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/meta/TestClassMetaData.java</exclude>
|
<exclude>org/apache/openjpa/persistence/meta/TestClassMetaData.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/meta/TestExternalValues.java</exclude>
|
<exclude>org/apache/openjpa/persistence/meta/TestExternalValues.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/meta/TestFieldDeclarationOrder.java</exclude>
|
<exclude>org/apache/openjpa/persistence/meta/TestFieldDeclarationOrder.java</exclude>
|
||||||
|
@ -535,18 +511,9 @@
|
||||||
<exclude>org/apache/openjpa/persistence/meta/TestSequenceAssigned.java</exclude>
|
<exclude>org/apache/openjpa/persistence/meta/TestSequenceAssigned.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/meta/TestValueStrategies.java</exclude>
|
<exclude>org/apache/openjpa/persistence/meta/TestValueStrategies.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/meta/TestXMLPersistenceMetaDataSerializer.java</exclude>
|
<exclude>org/apache/openjpa/persistence/meta/TestXMLPersistenceMetaDataSerializer.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestAccessPathsOfSubqueries.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestComplexQueries.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestEJBDeleteUpdateImpl.java</exclude>
|
<exclude>org/apache/openjpa/persistence/query/TestEJBDeleteUpdateImpl.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestEJBPolymorphicQuery.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestEJBQueryInterface.java</exclude>
|
<exclude>org/apache/openjpa/persistence/query/TestEJBQueryInterface.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestJPAQuerySubclassFunc.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestMathQueries.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestNamedQueries.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestQueryExpressionSplit.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestQueryResults.java</exclude>
|
<exclude>org/apache/openjpa/persistence/query/TestQueryResults.java</exclude>
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestQuotedNumbersInFilters2.java</exclude>
|
|
||||||
<exclude>org/apache/openjpa/persistence/query/TestSimple.java</exclude>
|
|
||||||
</excludes>
|
</excludes>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<property>
|
<property>
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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.common.utils.*;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
|
|
||||||
public class TestAdvAnnot extends AbstractTestCase
|
public class TestAdvAnnot extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
public TestAdvAnnot(String name)
|
public TestAdvAnnot(String name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.openjpa.persistence.common.utils.*;
|
||||||
|
|
||||||
import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.*;
|
import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.*;
|
||||||
|
|
||||||
public class TestAnnotationBasics extends AbstractTestCase {
|
public class TestAnnotationBasics extends AnnotationTestCase {
|
||||||
|
|
||||||
public TestAnnotationBasics(String name)
|
public TestAnnotationBasics(String name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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.annotations.common.apps.annotApp.ddtype.*;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
|
|
||||||
public class TestDDCallbackMethods extends AbstractTestCase
|
public class TestDDCallbackMethods extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestDDCallbackMethods(String name)
|
public TestDDCallbackMethods(String name)
|
||||||
|
|
|
@ -40,7 +40,7 @@ import junit.framework.*;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestEJBEmbedded extends AbstractTestCase
|
public class TestEJBEmbedded extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestEJBEmbedded(String name)
|
public TestEJBEmbedded(String name)
|
||||||
|
|
|
@ -38,7 +38,7 @@ import junit.framework.*;
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
public class TestEmbeddableSuperclass extends AbstractTestCase
|
public class TestEmbeddableSuperclass extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestEmbeddableSuperclass(String name)
|
public TestEmbeddableSuperclass(String name)
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.apache.openjpa.persistence.common.utils.*;
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
public class TestEmbeddedId extends AbstractTestCase
|
public class TestEmbeddedId extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestEmbeddedId(String name)
|
public TestEmbeddedId(String name)
|
||||||
|
|
|
@ -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.annotations.common.apps.annotApp.annotype.*;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
|
|
||||||
public class TestEntityListenerAnnot extends AbstractTestCase
|
public class TestEntityListenerAnnot extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestEntityListenerAnnot(String name)
|
public TestEntityListenerAnnot(String name)
|
||||||
|
|
|
@ -34,7 +34,7 @@ import junit.framework.*;
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
public class TestEntityOrderBy extends AbstractTestCase
|
public class TestEntityOrderBy extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestEntityOrderBy(String name)
|
public TestEntityOrderBy(String name)
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
public class TestEnumerated extends AbstractTestCase
|
public class TestEnumerated extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestEnumerated(String name)
|
public TestEnumerated(String name)
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestFlatInheritance extends AbstractTestCase
|
public class TestFlatInheritance extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestFlatInheritance(String name)
|
public TestFlatInheritance(String name)
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestGenerators extends AbstractTestCase
|
public class TestGenerators extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestGenerators(String name)
|
public TestGenerators(String name)
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestJoinedInheritance extends AbstractTestCase
|
public class TestJoinedInheritance extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestJoinedInheritance(String name)
|
public TestJoinedInheritance(String name)
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestManyToMany extends AbstractTestCase
|
public class TestManyToMany extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
public TestManyToMany(String name)
|
public TestManyToMany(String name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.apache.openjpa.persistence.common.utils.*;
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
public class TestMapKey extends AbstractTestCase
|
public class TestMapKey extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestMapKey(String name)
|
public TestMapKey(String name)
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.openjpa.persistence.common.utils.*;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestOneToMany extends AbstractTestCase
|
public class TestOneToMany extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
public TestOneToMany(String name)
|
public TestOneToMany(String name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestOneToOne extends AbstractTestCase
|
public class TestOneToOne extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestOneToOne(String name)
|
public TestOneToOne(String name)
|
||||||
|
|
|
@ -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)
|
public TestPropertyAccess(String name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.apache.openjpa.persistence.common.utils.*;
|
||||||
*
|
*
|
||||||
* @author Steve Kim
|
* @author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestSerializedLobs extends AbstractTestCase
|
public class TestSerializedLobs extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestSerializedLobs(String name)
|
public TestSerializedLobs(String name)
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.apache.openjpa.persistence.common.utils.*;
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
public class TestTablePerClassInheritance extends AbstractTestCase
|
public class TestTablePerClassInheritance extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TestTablePerClassInheritance(String name)
|
public TestTablePerClassInheritance(String name)
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.apache.openjpa.persistence.OpenJPAPersistence;
|
||||||
|
|
||||||
@author Steve Kim
|
@author Steve Kim
|
||||||
*/
|
*/
|
||||||
public class TestVersion extends AbstractTestCase
|
public class TestVersion extends AnnotationTestCase
|
||||||
{
|
{
|
||||||
private Object oid;
|
private Object oid;
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,10 @@ import java.io.ObjectInputStream;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
import java.net.URL;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.Query;
|
import javax.persistence.Query;
|
||||||
|
import javax.persistence.EntityManagerFactory;
|
||||||
import javax.management.IntrospectionException;
|
import javax.management.IntrospectionException;
|
||||||
|
|
||||||
import org.apache.regexp.RESyntaxException;
|
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.conf.OpenJPAConfiguration;
|
||||||
import org.apache.openjpa.kernel.OpenJPAStateManager;
|
import org.apache.openjpa.kernel.OpenJPAStateManager;
|
||||||
import org.apache.openjpa.kernel.BrokerFactory;
|
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.lib.log.Log;
|
||||||
|
import org.apache.openjpa.meta.ClassMetaData;
|
||||||
|
|
||||||
public abstract class AbstractTestCase extends PersistenceTestCase {
|
public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
|
|
||||||
|
private String persistenceXmlResource;
|
||||||
|
private Map<Map,OpenJPAEntityManagerFactory> emfs =
|
||||||
|
new HashMap<Map,OpenJPAEntityManagerFactory>();
|
||||||
|
private OpenJPAEntityManager currentEntityManager;
|
||||||
|
|
||||||
protected enum Platform {
|
protected enum Platform {
|
||||||
EMPRESS,
|
EMPRESS,
|
||||||
HYPERSONIC,
|
HYPERSONIC,
|
||||||
|
@ -107,6 +113,21 @@ public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
|
|
||||||
public AbstractTestCase(String name, String s) {
|
public AbstractTestCase(String name, String s) {
|
||||||
setName(name);
|
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() {
|
public AbstractTestCase() {
|
||||||
|
@ -116,28 +137,33 @@ public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
setName(name);
|
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,
|
protected OpenJPAStateManager getStateManager(Object obj,
|
||||||
EntityManager pm) {
|
EntityManager em) {
|
||||||
throw new UnsupportedOperationException();
|
return JPAFacadeHelper.toBroker(em).getStateManager(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int deleteAll(Class type, EntityManager em) {
|
protected int deleteAll(Class type, EntityManager em) {
|
||||||
final boolean useDeleteByQuery = true;
|
ClassMetaData meta = JPAFacadeHelper.getMetaData(em, type);
|
||||||
|
if (meta != null)
|
||||||
if (useDeleteByQuery) {
|
return em.createQuery("delete from " + meta.getTypeAlias())
|
||||||
Broker broker = JPAFacadeHelper.toBroker(em);
|
.executeUpdate();
|
||||||
org.apache.openjpa.kernel.Query query = broker.newQuery(
|
else
|
||||||
JPQLParser.LANG_JPQL, type, "");
|
return -1;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int deleteAll(Class... types) {
|
protected int deleteAll(Class... types) {
|
||||||
|
@ -152,6 +178,8 @@ public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OpenJPAEntityManagerFactory getEmf(Map map) {
|
protected OpenJPAEntityManagerFactory getEmf(Map map) {
|
||||||
|
if (map == null)
|
||||||
|
map = new HashMap();
|
||||||
Collection keys = new ArrayList();
|
Collection keys = new ArrayList();
|
||||||
for (Object key : map.keySet())
|
for (Object key : map.keySet())
|
||||||
if (key.toString().startsWith("kodo"))
|
if (key.toString().startsWith("kodo"))
|
||||||
|
@ -159,12 +187,28 @@ public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
if (keys.size() > 0)
|
if (keys.size() > 0)
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"kodo-prefixed properties must be converted to openjpa. " +
|
"kodo-prefixed properties must be converted to openjpa. " +
|
||||||
"Properties: " + keys);
|
"Properties: " + keys);
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
|
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() {
|
protected OpenJPAEntityManagerFactory getEmf() {
|
||||||
throw new UnsupportedOperationException();
|
Map m = new HashMap();
|
||||||
|
return getEmf(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BrokerFactory getBrokerFactory() {
|
protected BrokerFactory getBrokerFactory() {
|
||||||
|
@ -182,7 +226,9 @@ public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OpenJPAEntityManager currentEntityManager() {
|
protected OpenJPAEntityManager currentEntityManager() {
|
||||||
throw new UnsupportedOperationException();
|
if (currentEntityManager == null || !currentEntityManager.isOpen())
|
||||||
|
currentEntityManager = getEmf().createEntityManager();
|
||||||
|
return currentEntityManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startTx(EntityManager em) {
|
protected void startTx(EntityManager em) {
|
||||||
|
@ -209,6 +255,8 @@ public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
protected void endEm(EntityManager em) {
|
protected void endEm(EntityManager em) {
|
||||||
if (em.isOpen())
|
if (em.isOpen())
|
||||||
em.close();
|
em.close();
|
||||||
|
if (em == currentEntityManager)
|
||||||
|
currentEntityManager = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Object getStackTrace(Throwable t) {
|
protected Object getStackTrace(Throwable t) {
|
||||||
|
@ -216,7 +264,7 @@ public abstract class AbstractTestCase extends PersistenceTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OpenJPAConfiguration getConfiguration() {
|
protected OpenJPAConfiguration getConfiguration() {
|
||||||
throw new UnsupportedOperationException();
|
return getEmf().getConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Platform getCurrentPlatform() {
|
protected Platform getCurrentPlatform() {
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class Base
|
public class Base
|
||||||
implements Comparable {
|
implements Comparable {
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class BaseSub1
|
public class BaseSub1
|
||||||
extends Base {
|
extends Base {
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class BaseSub1Sub1
|
public class BaseSub1Sub1
|
||||||
extends BaseSub1 {
|
extends BaseSub1 {
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class BaseSub1Sub2
|
public class BaseSub1Sub2
|
||||||
extends BaseSub1 {
|
extends BaseSub1 {
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class BaseSub2
|
public class BaseSub2
|
||||||
extends Base {
|
extends Base {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type used in testing the mappingtool's buildSchema action.</p>
|
* <p>Persistent type used in testing the mappingtool's buildSchema action.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class BuildSchemaPC {
|
public class BuildSchemaPC {
|
||||||
|
|
||||||
private String stringField = null;
|
private String stringField = null;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type using a byte[] for a primary key field. Used in
|
* <p>Persistent type using a byte[] for a primary key field. Used in
|
||||||
|
@ -26,6 +27,7 @@ import java.util.*;
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class ByteArrayPKPC {
|
public class ByteArrayPKPC {
|
||||||
|
|
||||||
private byte[] pk = null;
|
private byte[] pk = null;
|
||||||
|
|
|
@ -18,12 +18,15 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type using a byte[] for a primary key field. Used in
|
* <p>Persistent type using a byte[] for a primary key field. Used in
|
||||||
* {@link TestByteArrayAppId}.</p>
|
* {@link TestByteArrayAppId}.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class ByteArrayPKPC2
|
public class ByteArrayPKPC2
|
||||||
extends ByteArrayPKPC {
|
extends ByteArrayPKPC {
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class ConstantJoinPC {
|
public class ConstantJoinPC {
|
||||||
|
|
||||||
private int pk1;
|
private int pk1;
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class ConstantJoinPC2
|
public class ConstantJoinPC2
|
||||||
extends ConstantJoinPC {
|
extends ConstantJoinPC {
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class ConstantJoinPC3
|
public class ConstantJoinPC3
|
||||||
extends ConstantJoinPC {
|
extends ConstantJoinPC {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type used in testing.</p>
|
* <p>Persistent type used in testing.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class DFGTest {
|
public class DFGTest {
|
||||||
|
|
||||||
private int dfgField;
|
private int dfgField;
|
||||||
|
|
|
@ -29,6 +29,7 @@ import java.lang.annotation.Annotation;
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class DataStoreTripsPC {
|
public class DataStoreTripsPC {
|
||||||
|
|
||||||
private int intField;
|
private int intField;
|
||||||
|
|
|
@ -19,12 +19,14 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Class that uses eager outer joins for its collection fields.</p>
|
* <p>Class that uses eager outer joins for its collection fields.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class EagerOuterJoinPC {
|
public class EagerOuterJoinPC {
|
||||||
|
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
|
@ -19,12 +19,14 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Helper class in eager to-many join testing.</p>
|
* <p>Helper class in eager to-many join testing.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class EagerOuterJoinPC2 {
|
public class EagerOuterJoinPC2 {
|
||||||
|
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class HelperPC2
|
||||||
@Column(name="strngfld", length=50)
|
@Column(name="strngfld", length=50)
|
||||||
private String stringField;
|
private String stringField;
|
||||||
|
|
||||||
@Id
|
@Id @GeneratedValue
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
|
@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
|
||||||
|
|
|
@ -20,8 +20,9 @@ package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public abstract class HorizA
|
public abstract class HorizA
|
||||||
implements Serializable {
|
implements Serializable {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizAppInterVerticalA
|
public class HorizAppInterVerticalA
|
||||||
implements HorizInterA {
|
implements HorizInterA {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizAppInterVerticalB
|
public class HorizAppInterVerticalB
|
||||||
extends HorizAppInterVerticalA
|
extends HorizAppInterVerticalA
|
||||||
implements HorizInterB {
|
implements HorizInterB {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizAppInterVerticalC
|
public class HorizAppInterVerticalC
|
||||||
extends HorizAppInterVerticalB
|
extends HorizAppInterVerticalB
|
||||||
implements HorizInterC {
|
implements HorizInterC {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizAppInterVerticalD
|
public class HorizAppInterVerticalD
|
||||||
extends HorizAppInterVerticalB
|
extends HorizAppInterVerticalB
|
||||||
implements HorizInterD {
|
implements HorizInterD {
|
||||||
|
|
|
@ -21,9 +21,11 @@ package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
import serp.util.*;
|
import serp.util.*;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppMultiA
|
public class HorizAppMultiA
|
||||||
implements HorizAppA {
|
implements HorizAppA {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppMultiB
|
public class HorizAppMultiB
|
||||||
extends HorizAppMultiA
|
extends HorizAppMultiA
|
||||||
implements HorizAppB {
|
implements HorizAppB {
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppMultiC
|
public class HorizAppMultiC
|
||||||
extends HorizAppMultiA
|
extends HorizAppMultiA
|
||||||
implements HorizAppC {
|
implements HorizAppC {
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppMultiD
|
public class HorizAppMultiD
|
||||||
extends HorizAppMultiA
|
extends HorizAppMultiA
|
||||||
implements HorizAppD {
|
implements HorizAppD {
|
||||||
|
|
|
@ -21,9 +21,11 @@ package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
import serp.util.*;
|
import serp.util.*;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppSingleA
|
public class HorizAppSingleA
|
||||||
implements HorizAppA {
|
implements HorizAppA {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppSingleB
|
public class HorizAppSingleB
|
||||||
extends HorizAppSingleA
|
extends HorizAppSingleA
|
||||||
implements HorizAppB {
|
implements HorizAppB {
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppSingleC
|
public class HorizAppSingleC
|
||||||
extends HorizAppSingleA
|
extends HorizAppSingleA
|
||||||
implements HorizAppC {
|
implements HorizAppC {
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizAppSingleD
|
public class HorizAppSingleD
|
||||||
extends HorizAppSingleA
|
extends HorizAppSingleA
|
||||||
implements HorizAppD {
|
implements HorizAppD {
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizB
|
public class HorizB
|
||||||
extends HorizA {
|
extends HorizA {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public abstract class HorizC
|
public abstract class HorizC
|
||||||
extends HorizA {
|
extends HorizA {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizD
|
public class HorizD
|
||||||
extends HorizC {
|
extends HorizC {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizE
|
public class HorizE
|
||||||
extends HorizC {
|
extends HorizC {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizF
|
public class HorizF
|
||||||
extends HorizE {
|
extends HorizE {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizG
|
public class HorizG
|
||||||
extends HorizE {
|
extends HorizE {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizH
|
public class HorizH
|
||||||
extends HorizG {
|
extends HorizG {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizI
|
public class HorizI
|
||||||
extends HorizG {
|
extends HorizG {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterFlatA
|
public class HorizInterFlatA
|
||||||
implements HorizInterA {
|
implements HorizInterA {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterFlatB
|
public class HorizInterFlatB
|
||||||
extends HorizInterFlatA
|
extends HorizInterFlatA
|
||||||
implements HorizInterB {
|
implements HorizInterB {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterFlatC
|
public class HorizInterFlatC
|
||||||
extends HorizInterFlatB
|
extends HorizInterFlatB
|
||||||
implements HorizInterC {
|
implements HorizInterC {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterFlatD
|
public class HorizInterFlatD
|
||||||
extends HorizInterFlatB
|
extends HorizInterFlatB
|
||||||
implements HorizInterD {
|
implements HorizInterD {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterVerticalA
|
public class HorizInterVerticalA
|
||||||
implements HorizInterA {
|
implements HorizInterA {
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterVerticalB
|
public class HorizInterVerticalB
|
||||||
extends HorizInterVerticalA
|
extends HorizInterVerticalA
|
||||||
implements HorizInterB {
|
implements HorizInterB {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterVerticalC
|
public class HorizInterVerticalC
|
||||||
extends HorizInterVerticalB
|
extends HorizInterVerticalB
|
||||||
implements HorizInterC {
|
implements HorizInterC {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for intermediate horizontal mappings with flat mappings.
|
* Interface for intermediate horizontal mappings with flat mappings.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizInterVerticalD
|
public class HorizInterVerticalD
|
||||||
extends HorizInterVerticalB
|
extends HorizInterVerticalB
|
||||||
implements HorizInterD {
|
implements HorizInterD {
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizJ
|
public class HorizJ
|
||||||
extends HorizD {
|
extends HorizD {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizK
|
public class HorizK
|
||||||
extends HorizJ {
|
extends HorizJ {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizL
|
public class HorizL
|
||||||
extends HorizJ {
|
extends HorizJ {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizM
|
public class HorizM
|
||||||
extends HorizL {
|
extends HorizL {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizN
|
public class HorizN
|
||||||
extends HorizM {
|
extends HorizM {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class HorizO
|
public class HorizO
|
||||||
extends HorizN {
|
extends HorizN {
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
import org.apache.commons.collections.*;
|
import org.apache.commons.collections.*;
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ import org.apache.commons.collections.*;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
* @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class HorizRelation
|
public class HorizRelation
|
||||||
implements Serializable {
|
implements Serializable {
|
||||||
///////////////////////
|
///////////////////////
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class InverseKeyMapPC
|
public class InverseKeyMapPC
|
||||||
implements MappedByMapPC {
|
implements MappedByMapPC {
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class JoinSubclassBase
|
public class JoinSubclassBase
|
||||||
implements Comparable {
|
implements Comparable {
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class JoinSubclassBaseSubFlat
|
public class JoinSubclassBaseSubFlat
|
||||||
extends JoinSubclassBaseSubVert {
|
extends JoinSubclassBaseSubVert {
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class JoinSubclassBaseSubVert
|
public class JoinSubclassBaseSubVert
|
||||||
extends JoinSubclassBase {
|
extends JoinSubclassBase {
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class JoinTableMapPC
|
public class JoinTableMapPC
|
||||||
implements MappedByMapPC {
|
implements MappedByMapPC {
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,14 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type with a compound primary key and LRS fields.</p>
|
* <p>Persistent type with a compound primary key and LRS fields.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class LRSCompoundPC
|
public class LRSCompoundPC
|
||||||
implements LRSPCIntf {
|
implements LRSPCIntf {
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,14 @@
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type with LRS fields.</p>
|
* <p>Persistent type with LRS fields.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class LRSPC
|
public class LRSPC
|
||||||
implements LRSPCIntf {
|
implements LRSPCIntf {
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,12 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used in testing; should be enhanced.
|
* Used in testing; should be enhanced.
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class LocatorTestObject {
|
public class LocatorTestObject {
|
||||||
|
|
||||||
private byte[] bytes;
|
private byte[] bytes;
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class LockGroupSubclass
|
public class LockGroupSubclass
|
||||||
extends HorizB {
|
extends HorizB {
|
||||||
|
|
||||||
|
|
|
@ -20,13 +20,14 @@ package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type used for testing.</p>
|
* <p>Persistent type used for testing.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class MappingTest1
|
public class MappingTest1
|
||||||
{
|
{
|
||||||
private int value = 0;
|
private int value = 0;
|
||||||
|
|
|
@ -28,6 +28,7 @@ import javax.persistence.*;
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Entity
|
||||||
public class MappingTest2
|
public class MappingTest2
|
||||||
{
|
{
|
||||||
private int pk1 = 0;
|
private int pk1 = 0;
|
||||||
|
|
|
@ -18,12 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type used in testing.</p>
|
* <p>Persistent type used in testing.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class MappingTest3
|
public class MappingTest3
|
||||||
extends MappingTest1
|
extends MappingTest1
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,12 +18,15 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type used in testing.</p>
|
* <p>Persistent type used in testing.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
|
|
||||||
public class MappingTest4
|
public class MappingTest4
|
||||||
extends MappingTest3
|
extends MappingTest3
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.openjpa.persistence.jdbc.common.apps;
|
package org.apache.openjpa.persistence.jdbc.common.apps;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Persistent type used in testing.</p>
|
* <p>Persistent type used in testing.</p>
|
||||||
*
|
*
|
||||||
* @author Abe White
|
* @author Abe White
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class MappingTest5
|
public class MappingTest5
|
||||||
extends MappingTest2 {
|
extends MappingTest2 {
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,12 @@ public class BaseJDBCTest extends org.apache.openjpa.persistence.common.utils.Ab
|
||||||
{
|
{
|
||||||
super(name, "jdbccactusapp");
|
super(name, "jdbccactusapp");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String defaultPersistenceXmlResource() {
|
||||||
|
return "org/apache/openjpa/persistence/jdbc/common" +
|
||||||
|
"/apps/META-INF/persistence.xml";
|
||||||
|
}
|
||||||
|
|
||||||
protected OpenJPAEntityManager getPM() {
|
protected OpenJPAEntityManager getPM() {
|
||||||
return (OpenJPAEntityManager)currentEntityManager();
|
return (OpenJPAEntityManager)currentEntityManager();
|
||||||
|
@ -136,10 +142,6 @@ public class BaseJDBCTest extends org.apache.openjpa.persistence.common.utils.Ab
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OpenJPAStateManager getStateManager(Object obj,OpenJPAEntityManager pm) {
|
|
||||||
return getStateManager(obj,pm);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Properties getProperties() {
|
protected Properties getProperties() {
|
||||||
return getProperties(null);
|
return getProperties(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,10 +76,10 @@ public class TestEagerDistinct extends org.apache.openjpa.persistence.jdbc.kerne
|
||||||
pc2.getHelperCollection().add(new HelperPC());
|
pc2.getHelperCollection().add(new HelperPC());
|
||||||
|
|
||||||
OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
|
OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
|
||||||
startTx(pm);;
|
startTx(pm);
|
||||||
pm.persist(pc1);
|
pm.persist(pc1);
|
||||||
pm.persist(pc2);
|
pm.persist(pc2);
|
||||||
endTx(pm);;
|
endTx(pm);
|
||||||
|
|
||||||
// to make sure subclasses are selected, etc
|
// to make sure subclasses are selected, etc
|
||||||
//FIXME jthomas
|
//FIXME jthomas
|
||||||
|
|
|
@ -23,6 +23,7 @@ import javax.persistence.EntityManager;
|
||||||
|
|
||||||
import org.apache.openjpa.persistence.common.apps.*;
|
import org.apache.openjpa.persistence.common.apps.*;
|
||||||
import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
|
import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
|
||||||
|
import org.apache.openjpa.persistence.InvalidStateException;
|
||||||
|
|
||||||
public class TestEJBQLCondExpression extends AbstractTestCase {
|
public class TestEJBQLCondExpression extends AbstractTestCase {
|
||||||
|
|
||||||
|
@ -281,7 +282,7 @@ public class TestEJBQLCondExpression extends AbstractTestCase {
|
||||||
EntityManager em = currentEntityManager();
|
EntityManager em = currentEntityManager();
|
||||||
|
|
||||||
String query =
|
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'";
|
" FROM CompUser c WHERE c.name = 'Seetha'";
|
||||||
|
|
||||||
MaleUser male = (MaleUser) em.createQuery(query).getSingleResult();
|
MaleUser male = (MaleUser) em.createQuery(query).getSingleResult();
|
||||||
|
|
|
@ -55,11 +55,11 @@ public abstract class BaseQueryTest extends org.apache.openjpa.persistence.commo
|
||||||
super(name, "querycactusapp");
|
super(name, "querycactusapp");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OpenJPAEntityManager getPM() {
|
protected OpenJPAEntityManager getEM() {
|
||||||
return (OpenJPAEntityManager) currentEntityManager();
|
return (OpenJPAEntityManager) currentEntityManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OpenJPAEntityManager getPM(boolean optimistic,
|
protected OpenJPAEntityManager getEM(boolean optimistic,
|
||||||
boolean retainValues) {
|
boolean retainValues) {
|
||||||
OpenJPAEntityManager em =
|
OpenJPAEntityManager em =
|
||||||
(OpenJPAEntityManager) currentEntityManager();
|
(OpenJPAEntityManager) currentEntityManager();
|
||||||
|
|
|
@ -289,134 +289,4 @@ public class TestComplexQueries extends BaseQueryTest {
|
||||||
"f.stringF = \'testfXXX\'",
|
"f.stringF = \'testfXXX\'",
|
||||||
ComplexG.class);
|
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);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class TestJPAQuerySubclassFunc extends BaseQueryTest {
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
deleteAll(RuntimeTest1.class);
|
deleteAll(RuntimeTest1.class);
|
||||||
|
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
startTx(pm);
|
startTx(pm);
|
||||||
|
|
||||||
pm.persist(new RuntimeTest1("TestQueryResults1", 10));
|
pm.persist(new RuntimeTest1("TestQueryResults1", 10));
|
||||||
|
@ -51,7 +51,7 @@ public class TestJPAQuerySubclassFunc extends BaseQueryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSubClassIsTrueFunction() {
|
public void testSubClassIsTrueFunction() {
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
startTx(pm);
|
startTx(pm);
|
||||||
|
|
||||||
OpenJPAQuery query =
|
OpenJPAQuery query =
|
||||||
|
@ -70,7 +70,7 @@ public class TestJPAQuerySubclassFunc extends BaseQueryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSubClassIsFalseFunction() {
|
public void testSubClassIsFalseFunction() {
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
startTx(pm);
|
startTx(pm);
|
||||||
|
|
||||||
OpenJPAQuery query =
|
OpenJPAQuery query =
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class TestMathQueries extends BaseQueryTest {
|
||||||
|
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
deleteAll(QueryTest1.class);
|
deleteAll(QueryTest1.class);
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
startTx(pm);
|
startTx(pm);
|
||||||
|
|
||||||
for (int i = 0; i <= 100; i++) {
|
for (int i = 0; i <= 100; i++) {
|
||||||
|
@ -69,9 +69,9 @@ public class TestMathQueries extends BaseQueryTest {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
OpenJPAQuery q1, q2;
|
OpenJPAQuery q1, q2;
|
||||||
q1 = getPM().createQuery(
|
q1 = getEM().createQuery(
|
||||||
"SELECT q FROM QueryTest1 q WHERE q.numb * q.numb = 25");
|
"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");
|
"SELECT q FROM QueryTest1 q WHERE q.numb * q.numb > 25");
|
||||||
|
|
||||||
assertSize(95, q2.getResultList());
|
assertSize(95, q2.getResultList());
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class TestNamedQueries extends BaseQueryTest {
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
deleteAll(QueryTest1.class);
|
deleteAll(QueryTest1.class);
|
||||||
|
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
startTx(pm);
|
startTx(pm);
|
||||||
QueryTest1 pc = null;
|
QueryTest1 pc = null;
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
|
@ -66,7 +66,7 @@ public class TestNamedQueries extends BaseQueryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamedClassQuery() {
|
public void testNamedClassQuery() {
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
|
|
||||||
OpenJPAQuery query = pm.createQuery("SELECT o FROM QueryTest1 o");
|
OpenJPAQuery query = pm.createQuery("SELECT o FROM QueryTest1 o");
|
||||||
query.setResultClass(QueryTest1.class);
|
query.setResultClass(QueryTest1.class);
|
||||||
|
@ -93,7 +93,7 @@ public class TestNamedQueries extends BaseQueryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamespace() {
|
public void testNamespace() {
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
OpenJPAQuery query = (OpenJPAQuery) pm.createNamedQuery("named");
|
OpenJPAQuery query = (OpenJPAQuery) pm.createNamedQuery("named");
|
||||||
assertEquals("SELECT o FROM QueryTest1 o", query.getQueryString());
|
assertEquals("SELECT o FROM QueryTest1 o", query.getQueryString());
|
||||||
query.closeAll();
|
query.closeAll();
|
||||||
|
@ -102,7 +102,7 @@ public class TestNamedQueries extends BaseQueryTest {
|
||||||
|
|
||||||
public void testSystemJDOQL() {
|
public void testSystemJDOQL() {
|
||||||
// make sure local query metadata is parsed
|
// make sure local query metadata is parsed
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
|
|
||||||
OpenJPAQuery query = (OpenJPAQuery) pm.createNamedQuery("named");
|
OpenJPAQuery query = (OpenJPAQuery) pm.createNamedQuery("named");
|
||||||
assertEquals("SELECT o FROM QueryTest1 o", query.getQueryString());
|
assertEquals("SELECT o FROM QueryTest1 o", query.getQueryString());
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class TestQueryExpressionSplit extends BaseQueryTest {
|
||||||
assertEquals(new String[]{ "foo() bar(boo)" },
|
assertEquals(new String[]{ "foo() bar(boo)" },
|
||||||
Filters.splitExpressions("foo() bar(boo)", ',', 3));
|
Filters.splitExpressions("foo() bar(boo)", ',', 3));
|
||||||
assertEquals(new String[]{ "foo() bar(boo)", "biz()", "baz(boo)" },
|
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));
|
',', 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class TestQuotedNumbersInFilters2 extends BaseQueryTest {
|
||||||
|
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
deleteAll(RuntimeTest1.class);
|
deleteAll(RuntimeTest1.class);
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
startTx(pm);
|
startTx(pm);
|
||||||
pm.persist(new RuntimeTest1("foo", 3));
|
pm.persist(new RuntimeTest1("foo", 3));
|
||||||
pm.persist(new RuntimeTest1("bar", 15));
|
pm.persist(new RuntimeTest1("bar", 15));
|
||||||
|
@ -140,7 +140,7 @@ public class TestQuotedNumbersInFilters2 extends BaseQueryTest {
|
||||||
* queries.
|
* queries.
|
||||||
*/
|
*/
|
||||||
private long helper(String filter, boolean shouldFail) {
|
private long helper(String filter, boolean shouldFail) {
|
||||||
OpenJPAEntityManager pm = getPM();
|
OpenJPAEntityManager pm = getEM();
|
||||||
|
|
||||||
OpenJPAQuery q =
|
OpenJPAQuery q =
|
||||||
pm.createQuery("SELECT r FROM RuntimeTest1 r WHERE r." + filter);
|
pm.createQuery("SELECT r FROM RuntimeTest1 r WHERE r." + filter);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue