svn commit: r495673 [1/2] - in /db/ojb/trunk/src: schema/ test/org/apache/ojb/ test/org/apache/ojb/broker/ test/org/apache/ojb/broker/cache/ test/org/apache/ojb/broker/lob/ test/org/apache/ojb/broker/metadata/ test/org/apache/ojb/broker/sequence/ test/...

[email protected]
Newsgroups gmane.comp.jakarta.ojb.devel
Message-ID <[email protected]>
Author: arminw
Date: Fri Jan 12 10:13:08 2007
New Revision: 495673

URL: http://svn.apache.org/viewvc?view=rev&rev=495673
Log:
- merge trunk with OJB 1.0.x branch
- continue work on caching
- continue work on batch handling
- introduce possibility to persist generic objects at runtime (used to populate the m:n indirection table)

Modified:
    db/ojb/trunk/src/schema/ojbcore-schema.xml
    db/ojb/trunk/src/schema/ojbtest-schema.xml
    db/ojb/trunk/src/test/org/apache/ojb/OJB-logging.properties
    db/ojb/trunk/src/test/org/apache/ojb/OJB.properties
    db/ojb/trunk/src/test/org/apache/ojb/Test_ClassDescriptor.xml
    db/ojb/trunk/src/test/org/apache/ojb/Test_ConnectionDescriptor.xml
    db/ojb/trunk/src/test/org/apache/ojb/Test_Repository.xml
    db/ojb/trunk/src/test/org/apache/ojb/Test_Repository_Renamed_DTD.xml
    db/ojb/trunk/src/test/org/apache/ojb/broker/AllTests.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/CollectionTest2.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/FactoryTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/GuidTestEntity.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/MetaDataSerializationTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/MtoNMapping.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/MultipleDBTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingMultithreadedTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/ProxyExamples.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/QueryTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/RowReaderTestImpl.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/UnwrapHelperTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/lob/LOBTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/sequence/DatabaseIdentityTest.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/sequence/SequenceManagerHandle.java
    db/ojb/trunk/src/test/org/apache/ojb/broker/sequence/SequenceManagerTest.java
    db/ojb/trunk/src/test/org/apache/ojb/faraway-db/OJB_FarAway.script
    db/ojb/trunk/src/test/org/apache/ojb/junit/PBTestCase.java
    db/ojb/trunk/src/test/org/apache/ojb/odmg/CollectionsTest.java
    db/ojb/trunk/src/test/org/apache/ojb/odmg/LockingMultithreadedTest.java
    db/ojb/trunk/src/test/org/apache/ojb/quick-db/OJB.script
    db/ojb/trunk/src/test/org/apache/ojb/repository_database.xml
    db/ojb/trunk/src/test/org/apache/ojb/repository_internal.xml
    db/ojb/trunk/src/test/org/apache/ojb/repository_junit_inheritance.xml
    db/ojb/trunk/src/test/org/apache/ojb/repository_junit_meta_seq.xml
    db/ojb/trunk/src/test/org/apache/ojb/repository_junit_reference.xml
    db/ojb/trunk/src/test/org/apache/ojb/spy.properties
    db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/TestObjectCache.java

Modified: db/ojb/trunk/src/schema/ojbcore-schema.xml
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/schema/ojbcore-schema.xml?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/schema/ojbcore-schema.xml (original)
+++ db/ojb/trunk/src/schema/ojbcore-schema.xml Fri Jan 12 10:13:08 2007
@@ -19,9 +19,8 @@
 <database name="@DATABASE_DEFAULT@" defaultIdMethod="none">
 
  <table name="OJB_HL_SEQ" description="HIGH/LOW SequenceManager table">
-    <column name="TABLENAME" required="true" primaryKey="true" type="VARCHAR" size="250"/>
+    <column name="NAME" required="true" primaryKey="true" type="VARCHAR" size="250"/>
     <column name="MAX_KEY" type="BIGINT"/>
-    <column name="GRAB_SIZE" type="INTEGER"/>
     <column name="VERSION" type="INTEGER"/>
   </table>
 

Modified: db/ojb/trunk/src/schema/ojbtest-schema.xml
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/schema/ojbtest-schema.xml?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/schema/ojbtest-schema.xml (original)
+++ db/ojb/trunk/src/schema/ojbtest-schema.xml Fri Jan 12 10:13:08 2007
@@ -1848,45 +1848,107 @@
         <column name="DESCRIPTION" type="VARCHAR" size="250"/>
     </table>
 
-    <table name="FIRST_">
+    <table name="TPS_FIRST">
 		<column
 		   name="ID_"
 		   type="INTEGER"
 		   primaryKey="true"/>
 		<column
-		   name="NAME"
-		   type="VARCHAR"/>
+		   name="NAME_"
+		   type="VARCHAR"
+           size="250"/>
 	</table>
 
-	<table name="SECOND_">
+	<table name="TPS_SECOND">
 		<column
 		   name="ID_"
 		   type="INTEGER"
 		   primaryKey="true"/>
 		<column
-		   name="SECOND"
-		   type="VARCHAR"/>
+		   name="SECOND_"
+		   type="VARCHAR"
+           size="250"/>
 		<column
 		   name="FIRST_FK"
 		   type="INTEGER"/>
-		<foreign-key foreignTable="FIRST_">
+		<foreign-key foreignTable="TPS_FIRST">
 			<reference local="FIRST_FK" foreign="ID_"/>
 		</foreign-key>
 	</table>
 
-	<table name="THIRD_">
+	<table name="TPS_THIRD">
 		<column
 		   name="ID_"
 		   type="INTEGER"
 		   primaryKey="true"/>
 		<column
-		   name="THIRD"
-		   type="VARCHAR"/>
+		   name="THIRD_"
+		   type="VARCHAR"
+           size="250"/>
 		<column
+		   name="SECOND_FK"
+		   type="INTEGER"/>
+		<foreign-key foreignTable="TPS_SECOND">
+			<reference local="SECOND_FK" foreign="ID_"/>
+		</foreign-key>
+	</table>
+
+    <table name="TPS_FOURTH_A">
+		<column
+		   name="ID_A"
+		   type="INTEGER"
+		   primaryKey="true"/>
+		<column
+		   name="FOURTH_"
+		   type="VARCHAR"
+           size="250"/>
+        <column
+		   name="THIRD_FK"
+		   type="INTEGER"/>
+		<foreign-key foreignTable="TPS_THIRD">
+			<reference local="THIRD_FK" foreign="ID_"/>
+		</foreign-key>
+	</table>
+
+	<table name="TPS_FOURTH_B">
+		<column
+		   name="ID_"
+		   type="INTEGER"
+		   primaryKey="true"/>
+		<column
+		   name="FOURTH_"
+		   type="VARCHAR"
+           size="250"/>
+        <column
 		   name="THIRD_FK"
 		   type="INTEGER"/>
-		<foreign-key foreignTable="THIRD_">
+		<foreign-key foreignTable="TPS_THIRD">
 			<reference local="THIRD_FK" foreign="ID_"/>
+		</foreign-key>
+	</table>
+
+	<table name="ONE_TO_ONE_PERS">
+		<column
+		   name="ID_"
+		   type="INTEGER"
+		   primaryKey="true"/>
+		<column
+		   name="NAME_"
+		   type="VARCHAR"
+           size="250"/>
+	</table>
+
+    <table name="ONE_TO_ONE_PASS">
+		<column
+		   name="ID_"
+		   type="INTEGER"
+		   primaryKey="true"/>
+		<column
+		   name="NUMBER_"
+		   type="VARCHAR"
+           size="250"/>
+		<foreign-key foreignTable="ONE_TO_ONE_PERS">
+			<reference local="ID_" foreign="ID_"/>
 		</foreign-key>
 	</table>
 

Modified: db/ojb/trunk/src/test/org/apache/ojb/OJB-logging.properties
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/OJB-logging.properties?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/OJB-logging.properties (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/OJB-logging.properties Fri Jan 12 10:13:08 2007
@@ -88,6 +88,10 @@
 org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.LogLevel=WARN
 org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl.LogLevel=WARN
 #
+# Logger for Oracle/9i platform, useful for tracing failing Oracle-extensions or large LOB-support
+org.apache.ojb.broker.platforms.PlatformOracle9iImpl.LogLevel=WARN
+org.apache.ojb.broker.platforms.PlatformOracleImpl.LogLevel=WARN
+#
 # Logger for object caching
 org.apache.ojb.broker.cache.CacheDistributor.LogLevel=WARN
 org.apache.ojb.broker.cache.MaterializationCache.LogLevel=WARN

Modified: db/ojb/trunk/src/test/org/apache/ojb/OJB.properties
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/OJB.properties?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/OJB.properties (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/OJB.properties Fri Jan 12 10:13:08 2007
@@ -105,8 +105,8 @@
 #
 # NOTE: The appropriate cooresponding IndirectionHandler must be choosen as well
 #
-#ProxyFactoryClass=org.apache.ojb.broker.core.proxy.ProxyFactoryCGLIBImpl
-ProxyFactoryClass=org.apache.ojb.broker.core.proxy.ProxyFactoryJDKImpl
+ProxyFactoryClass=org.apache.ojb.broker.core.proxy.ProxyFactoryCGLIBImpl
+#ProxyFactoryClass=org.apache.ojb.broker.core.proxy.ProxyFactoryJDKImpl
 #
 # The optional IndirectionHandlerClass entry defines the class to be used by OJB's proxies to
 # handle method invocations. The IndirectionHandler implementation must match the implementation
@@ -115,8 +115,8 @@
 # If this setting is unspecifies, then the default IndirectionHandler for the specified ProxyFactory
 # will be used.
 #
-#IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerCGLIBImpl
-IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerJDKImpl
+IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerCGLIBImpl
+#IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerJDKImpl
 #
 #----------------------------------------------------------------------------------------
 # ListProxy

Modified: db/ojb/trunk/src/test/org/apache/ojb/Test_ClassDescriptor.xml
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/Test_ClassDescriptor.xml?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/Test_ClassDescriptor.xml (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/Test_ClassDescriptor.xml Fri Jan 12 10:13:08 2007
@@ -76,10 +76,9 @@
        <object-cache class="org.apache.ojb.broker.cache.ObjectCacheEmptyImpl">
        </object-cache>
 
-       <!-- TODO: Rename column TABLENAME to NAME or SEQ_NAME -->
        <field-descriptor
          name="name"
-         column="TABLENAME"
+         column="NAME"
          jdbc-type="VARCHAR"
          primarykey="true"
       />
@@ -87,11 +86,6 @@
          name="maxKey"
          column="MAX_KEY"
          jdbc-type="BIGINT"
-      />
-      <field-descriptor
-         name="grabSize"
-         column="GRAB_SIZE"
-         jdbc-type="INTEGER"
       />
       <field-descriptor
          name="version"

Modified: db/ojb/trunk/src/test/org/apache/ojb/Test_ConnectionDescriptor.xml
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/Test_ConnectionDescriptor.xml?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/Test_ConnectionDescriptor.xml (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/Test_ConnectionDescriptor.xml Fri Jan 12 10:13:08 2007
@@ -148,7 +148,7 @@
         </connection-factory>
 
         <object-cache class="org.apache.ojb.broker.cache.ObjectCacheEmptyImpl"
-            strategy="org.apache.ojb.broker.cache.CachingStrategyDefaultImpl"
+            strategy="org.apache.ojb.broker.cache.CachingPipeNoopImpl"
         >
             <attribute attribute-name="cacheKey1" attribute-value="cacheValue1"/>
             <attribute attribute-name="cacheKey2" attribute-value="cacheValue2"/>

Modified: db/ojb/trunk/src/test/org/apache/ojb/Test_Repository.xml
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/Test_Repository.xml?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/Test_Repository.xml (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/Test_Repository.xml Fri Jan 12 10:13:08 2007
@@ -63,7 +63,7 @@
         </connection-factory>
 
         <object-cache class="org.apache.ojb.broker.cache.ObjectCacheEmptyImpl"
-            strategy="org.apache.ojb.broker.cache.CachingStrategyDefaultImpl"
+            strategy="org.apache.ojb.broker.cache.CachingPipeNoopImpl"
         >
             <attribute attribute-name="attr_con" attribute-value="555"/>
         </object-cache>

Modified: db/ojb/trunk/src/test/org/apache/ojb/Test_Repository_Renamed_DTD.xml
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/Test_Repository_Renamed_DTD.xml?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/Test_Repository_Renamed_DTD.xml (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/Test_Repository_Renamed_DTD.xml Fri Jan 12 10:13:08 2007
@@ -66,7 +66,7 @@
             <attribute attribute-name="whenExhaustedAction" attribute-value="0"/>
         </connection-factory>
 
-        <sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl">
+        <sequence-manager class="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl">
             <attribute attribute-name="seq.grabSize" attribute-value="5"/>
         </sequence-manager>
 

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/AllTests.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/AllTests.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/AllTests.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/AllTests.java Fri Jan 12 10:13:08 2007
@@ -112,6 +112,7 @@
         suite.addTestSuite(ObjectCacheTest.class);
         suite.addTestSuite(LocalCacheTest.class);
         suite.addTestSuite(ReferenceTest.class);
+        suite.addTestSuite(OneToOneWithoutFKTest.class);
         suite.addTestSuite(ComplexReferenceTest.class);
         suite.addTestSuite(ExtentAwarePathExpressionsTest.class);
         suite.addTestSuite(MultipleTableExtentAwareQueryTest.class);

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java Fri Jan 12 10:13:08 2007
@@ -275,6 +275,9 @@
 
         broker.beginTransaction();
         broker.delete(b);
+        // unlink deleted object B from object A
+        broker.serviceBrokerHelper().unlink(a, "relatedB");
+        broker.store(a, ObjectModification.UPDATE);
         broker.commitTransaction();
 
         crit = new Criteria();

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/CollectionTest2.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/CollectionTest2.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/CollectionTest2.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/CollectionTest2.java Fri Jan 12 10:13:08 2007
@@ -9,6 +9,7 @@
 
 import org.apache.commons.lang.SerializationUtils;
 import org.apache.ojb.broker.accesslayer.sql.SqlGenerator;
+import org.apache.ojb.broker.accesslayer.JoinSyntaxTypes;
 import org.apache.ojb.broker.core.proxy.ProxyFactory;
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 import org.apache.ojb.broker.metadata.CollectionDescriptor;
@@ -26,7 +27,6 @@
  * are NOT recommended in multithreaded environments, because they are global
  * and each thread will be affected.
  *
- * @author <a href="mailto:[email protected]">Armin Waibel</a>
  * @version $Id$
  */
 public class CollectionTest2 extends PBTestCase
@@ -57,11 +57,12 @@
         changeAutoSetting(Project.class, "subProject_2s", true, true, false, false);
         changeAutoSetting(Project.class, "developers", true, true, false, false);
         changeAutoSetting(SubProject.class, "project", true, true, false, false);
+        changeAutoSetting(SubProject_2.class, "project", true, true, false, false);
 
         Project project = new Project(name, null, null);
 
         Timestamp t1 = new Timestamp(System.currentTimeMillis());
-        Timestamp t2 = new Timestamp(t1.getTime() + 1);
+        Timestamp t2 = new Timestamp(t1.getTime() + 1000);
         broker.beginTransaction();
         // first store the project to assign the PK
         broker.store(project);
@@ -739,29 +740,29 @@
         changeAutoSetting(SubProjectSelfRef.class, "developers", true, CollectionDescriptor.CASCADE_OBJECT,
                 CollectionDescriptor.CASCADE_NONE, false);
 
-        String name = "testSelfReference" + System.currentTimeMillis();
+        String name = "testSelfReference_" + System.currentTimeMillis();
 
-        DeveloperSelf dev1 = new DeveloperSelf(name + "A");
-        DeveloperSelf dev2 = new DeveloperSelf(name + "B");
-        DeveloperSelf dev3 = new DeveloperSelf(name + "C");
+        DeveloperSelf dev1 = new DeveloperSelf(name + "_A");
+        DeveloperSelf dev2 = new DeveloperSelf(name + "_B");
+        DeveloperSelf dev3 = new DeveloperSelf(name + "_C");
         ArrayList devList = new ArrayList();
         devList.add(dev1);
         devList.add(dev2);
         ArrayList sub1devList = new ArrayList();
         sub1devList.add(dev3);
 
-        SubProjectSelfRef sub1 = new SubProjectSelfRef(name + "A");
-        SubProjectSelfRef sub2 = new SubProjectSelfRef(name + "B");
+        SubProjectSelfRef sub1 = new SubProjectSelfRef(name + "_A");
+        SubProjectSelfRef sub2 = new SubProjectSelfRef(name + "_B");
         ArrayList subList = new ArrayList();
         subList.add(sub1);
         subList.add(sub2);
 
-        SubProjectSelfRef pro = new SubProjectSelfRef(name + "MAIN");
+        SubProjectSelfRef pro = new SubProjectSelfRef(name + "_MAIN");
         pro.setSubProjects(subList);
         pro.setDevelopers(devList);
         sub1.setDevelopers(sub1devList);
 
-        Query queryProject = createQueryFor(SubProjectSelfRef.class, "name", name + "MAIN");
+        Query queryProject = createQueryFor(SubProjectSelfRef.class, "name", name + "_MAIN");
         Query querySubProject = createQueryFor(SubProjectSelfRef.class, "name", name);
         Query queryDeveloper = createQueryFor(DeveloperSelf.class, "name", name);
 
@@ -797,26 +798,30 @@
         result = broker.getCollectionByQuery(queryBySubDeveloper);
         assertEquals(1, result.size());
 
-        ClassDescriptor cd = broker.getClassDescriptor(queryBySubDeveloper.getBaseClass());
-        SqlGenerator sqlg = broker.serviceSqlGenerator();
-        String sql = sqlg.getPreparedSelectStatement(queryBySubDeveloper, cd).getStatement();
-        assertFalse(sql.indexOf("OUTER JOIN") >= 0);
-        assertTrue(sql.indexOf("INNER JOIN") >= 0);
-
-        // generates OUTER joins between COL_2_SUB_PROJECT_SELF and COL_2_SUB_PROJECT_SELF and COL_2_DEVELOPER_SELF 
-        QueryByCriteria queryBySubDeveloper2 = createQueryFor(SubProjectSelfRef.class, "subProjects.developers.name",
-                dev3.getName());
-        queryBySubDeveloper2.setDistinct(true);
-        queryBySubDeveloper2.setPathOuterJoin("subProjects");
-        queryBySubDeveloper2.setPathOuterJoin("subProjects.developers");
-        result = broker.getCollectionByQuery(queryBySubDeveloper2);
-        assertEquals(1, result.size());
-
-        cd = broker.getClassDescriptor(queryBySubDeveloper2.getBaseClass());
-        sqlg = broker.serviceSqlGenerator();
-        sql = sqlg.getPreparedSelectStatement(queryBySubDeveloper2, cd).getStatement();
-        assertTrue(sql.indexOf("OUTER JOIN") >= 0);
-        assertFalse(sql.indexOf("INNER JOIN") >= 0);
+        byte joinSyntax = broker.serviceConnectionManager().getSupportedPlatform().getJoinSyntaxType();
+        if(joinSyntax == JoinSyntaxTypes.SQL92_JOIN_SYNTAX || joinSyntax == JoinSyntaxTypes.SQL92_NOPAREN_JOIN_SYNTAX)
+        {
+            ClassDescriptor cd = broker.getClassDescriptor(queryBySubDeveloper.getBaseClass());
+            SqlGenerator sqlg = broker.serviceSqlGenerator();
+            String sql = sqlg.getPreparedSelectStatement(queryBySubDeveloper, cd).getStatement();
+            assertFalse(sql.indexOf("OUTER JOIN") >= 0);
+            assertTrue(sql.indexOf("INNER JOIN") >= 0);
+
+            // generates OUTER joins between COL_2_SUB_PROJECT_SELF and COL_2_SUB_PROJECT_SELF and COL_2_DEVELOPER_SELF
+            QueryByCriteria queryBySubDeveloper2 = createQueryFor(SubProjectSelfRef.class, "subProjects.developers.name",
+                    dev3.getName());
+            queryBySubDeveloper2.setDistinct(true);
+            queryBySubDeveloper2.setPathOuterJoin("subProjects");
+            queryBySubDeveloper2.setPathOuterJoin("subProjects.developers");
+            result = broker.getCollectionByQuery(queryBySubDeveloper2);
+            assertEquals(1, result.size());
+
+            cd = broker.getClassDescriptor(queryBySubDeveloper2.getBaseClass());
+            sqlg = broker.serviceSqlGenerator();
+            sql = sqlg.getPreparedSelectStatement(queryBySubDeveloper2, cd).getStatement();
+            assertTrue(sql.indexOf("OUTER JOIN") >= 0);
+            assertFalse(sql.indexOf("INNER JOIN") >= 0);
+        }
     }
 
 

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/FactoryTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/FactoryTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/FactoryTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/FactoryTest.java Fri Jan 12 10:13:08 2007
@@ -67,15 +67,14 @@
 		for (Iterator iter = coll.iterator(); iter.hasNext();)
 		{
 			InitializableObject obj = (InitializableObject) iter.next();
-			// ** OBS ** : this assertion fails because the ObjectCreator is not handled to the RowReader instance
-			assertFalse(obj.initCalled);
+			assertTrue(obj.initCalled);
 		}
 	}
 
     public void tearDown() throws Exception
     {
         // to avoid cache hits (which would not create new objects)
-        persistenceConf.getCachingManager().clearCaches();
+        persistenceConf.getCachingManager().evictAll();
         super.tearDown();
     }
 }

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/GuidTestEntity.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/GuidTestEntity.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/GuidTestEntity.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/GuidTestEntity.java Fri Jan 12 10:13:08 2007
@@ -17,14 +17,15 @@
 {
 	private GUID guid;
 	private String value;
-	
-    /**
-     * Constructor for GuidTestEntity.
-     */
+
     public GuidTestEntity()
     {
+    }
+
+    public GuidTestEntity(String guid)
+    {
         super();
-        guid = new GUID();
+        this.guid = new GUID(guid);
         value = new Date().toString();
     }
 

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java Fri Jan 12 10:13:08 2007
@@ -23,7 +23,6 @@
  * reference descriptor. The test objects use a composite PK.
  * One autoincrement PK field - Integer. One non-autoincrement PK field with manually set PK- Long.
  *
- * @author <a href="mailto:[email protected]">Armin Waibel</a>
  * @version $Id$
  */
 public class InheritanceMultipleTableTest extends PBTestCase
@@ -173,12 +172,6 @@
 
     public void testQueryInheritancedObjects()
     {
-        if(ojbSkipKnownIssueProblem("Classes mapped to multiple joined tables will always be instantiated " +
-                " with the class type of the query, instead of the real type"))
-        {
-            return;
-        }
-
         long timestamp = System.currentTimeMillis();
         String name = "testQueryInheritancedObjects_" + timestamp;
         // store company with Employee/Executive/Manager
@@ -332,10 +325,10 @@
 
     public void testJavaInheritance()
     {
-        ojbSkipKnownIssueProblem("Declared inheritance (without java inheritance)" +
-                "of classes is currently not supported and will be difficult to implement");
+        // Declared inheritance (without java inheritance)
+        // of classes is currently not supported and will be difficult to implement
 
-        String name = "testWithoutJavaInheritance_tmp" + System.currentTimeMillis();
+        String name = "testJavaInheritance_" + System.currentTimeMillis();
         Animal animal = new Animal(name, 55);
         Food f1 = new Food(name + "fruit1");
         Food f2 = new Food(name + "fruit2");
@@ -364,12 +357,6 @@
 
     public void testInheritancedObjectsInCollectionReferences()
     {
-        if(ojbSkipKnownIssueProblem("References of classes (1:1, 1:n) mapped to multiple joined tables only" +
-                " return base class type instances"))
-        {
-            return;
-        }
-
         long timestamp = System.currentTimeMillis();
         String name = "testInheritancedObjectsInCollectionReferences_" + timestamp;
         Company company = prepareTestDataWithCompany(name);
@@ -1463,14 +1450,73 @@
         assertNull(newThird);
     }
 
-    public void testInsertDeletePerSubClassViaFK_Serialized()
+    public void testInheritanceViaAnonymousField_Serialized_1()
     {
         long timestamp = System.currentTimeMillis();
-        String name = "testInsertDeletePerSubClassViaFK_Serialized_" + timestamp;
-        First first = new First("first_" + name);
-        Second second = new Second("second_" + name);
+        String name = "testInheritanceViaAnonymousField_Serialized_1_" + timestamp;
+        String t_name = "third_" + name;
+
+        Third third = new Third(t_name);
+        third.setThird("third");
+        third.setSecond("second");
+
+        broker.beginTransaction();
+        broker.store(third);
+        broker.commitTransaction();
+
+        Identity oid_3 = broker.serviceIdentity().buildIdentity(third);
+
+        broker.clearCache();
+
+        Third newThird = (Third) broker.getObjectByIdentity(oid_3);
+
+        assertNotNull(newThird);
+        assertEquals(t_name, newThird.getName());
+        assertEquals("third", third.getThird());
+        assertEquals("second", third.getSecond());
+
+        newThird.setName(newThird.getName() + "_updated");
+        newThird.setThird("third_updated");
+        newThird.setSecond("second_updated");
+
+        newThird = (Third) SerializationUtils.clone(newThird);
+
+        broker.beginTransaction();
+        broker.store(newThird);
+        broker.commitTransaction();
+
+        broker.clearCache();
+
+        newThird = (Third) broker.getObjectByIdentity(oid_3);
+
+        assertNotNull(newThird);
+        assertEquals(t_name + "_updated", newThird.getName());
+        assertEquals("second_updated", newThird.getSecond());
+        assertEquals("third_updated", newThird.getThird());
+
+        newThird = (Third) SerializationUtils.clone(newThird);
+
+        broker.beginTransaction();
+        broker.delete(newThird);
+        broker.commitTransaction();
+
+        newThird = (Third) broker.getObjectByIdentity(oid_3);
+
+        assertNull(newThird);
+    }
+
+    public void testInheritanceViaAnonymousField_Serialized_2()
+    {
+        long timestamp = System.currentTimeMillis();
+        String name = "testInheritanceViaAnonymousField_2_" + timestamp;
+        String f_name = "first_" + name;
+        String s_name = "second_" + name;
+        String t_name = "third_" + name;
+
+        First first = new First(f_name);
+        Second second = new Second(s_name);
         second.setSecond("second");
-        Third third = new Third("third_" + name);
+        Third third = new Third(t_name);
         third.setThird("third");
 
         broker.beginTransaction();
@@ -1492,14 +1538,17 @@
         assertNotNull(newFirst);
         assertNotNull(newSecond);
         assertNotNull(newThird);
+        assertEquals(f_name, newFirst.getName());
+        assertEquals(s_name, newSecond.getName());
+        assertEquals(t_name, newThird.getName());
         assertEquals("second", second.getSecond());
         assertEquals("third", third.getThird());
         assertNull(third.getSecond());
 
-        newFirst.setName(name + "_updated");
-        newSecond.setName(name + "_updated");
+        newFirst.setName(newFirst.getName() + "_updated");
+        newSecond.setName(newSecond.getName() + "_updated");
         newSecond.setSecond("second_updated");
-        newThird.setName(name + "_updated");
+        newThird.setName(newThird.getName() + "_updated");
         newThird.setThird("third_updated");
         newThird.setSecond("third");
 
@@ -1522,13 +1571,32 @@
         assertNotNull(newFirst);
         assertNotNull(newSecond);
         assertNotNull(newThird);
-        assertEquals(name + "_updated", newFirst.getName());
-        assertEquals(name + "_updated", newSecond.getName());
-        assertEquals(name + "_updated", newThird.getName());
+        assertEquals(f_name + "_updated", newFirst.getName());
+        assertEquals(s_name + "_updated", newSecond.getName());
+        assertEquals(t_name + "_updated", newThird.getName());
         assertEquals("second_updated", newSecond.getSecond());
         assertEquals("third_updated", newThird.getThird());
         assertEquals("third", newThird.getSecond());
 
+        Criteria c = new Criteria().addLike("name", "%" + name + "%");
+        Query q = QueryFactory.newQuery(First.class, c);
+        Collection result = broker.getCollectionByQuery(q);
+        assertEquals(3, result.size());
+        int count = 0;
+        for(Iterator iterator = result.iterator(); iterator.hasNext();)
+        {
+            Object o =  iterator.next();
+            if(o instanceof Second)
+            {
+                count+=1;
+                if(o instanceof Third)
+                {
+                    count+=7;
+                }
+            }
+        }
+        assertEquals("Wrong instances returned, expect First, Second, Third", 9, count);
+
         newFirst = (First) SerializationUtils.clone(newFirst);
         newSecond = (Second) SerializationUtils.clone(newSecond);
         newThird = (Third) SerializationUtils.clone(newThird);
@@ -1548,6 +1616,133 @@
         assertNull(newThird);
     }
 
+    public void testInheritanceViaAnonymousField_Serialized_3()
+    {
+//        if(ojbSkipKnownIssueProblem("Table-per-subclass inheritance issue, when field was overridden in sub-class"))
+//        {
+//            return;
+//        }
+        long timestamp = System.currentTimeMillis();
+        String name = "testInheritanceViaAnonymousField_3_" + timestamp;
+        String t_name = "fourth_" + name;
+
+        FourthA fourth = new FourthA(t_name);
+        fourth.setFourth("fourth");
+        fourth.setThird("third");
+        fourth.setSecond("second");
+
+        broker.beginTransaction();
+        broker.store(fourth);
+        broker.commitTransaction();
+
+        Identity oid_3 = broker.serviceIdentity().buildIdentity(fourth);
+
+        broker.clearCache();
+
+        FourthA newFourth = (FourthA) broker.getObjectByIdentity(oid_3);
+
+        assertNotNull(newFourth);
+        assertEquals(t_name, newFourth.getName());
+        assertEquals("fourth", fourth.getFourth());
+        assertEquals("third", fourth.getThird());
+        assertEquals("second", fourth.getSecond());
+
+        newFourth.setName(newFourth.getName() + "_updated");
+        newFourth.setFourth("fourth_updated");
+        newFourth.setThird("third_updated");
+        newFourth.setSecond("second_updated");
+
+        newFourth = (FourthA) SerializationUtils.clone(newFourth);
+
+        broker.beginTransaction();
+        broker.store(newFourth);
+        broker.commitTransaction();
+
+        broker.clearCache();
+
+        newFourth = (FourthA) broker.getObjectByIdentity(oid_3);
+
+        assertNotNull(newFourth);
+        assertEquals(t_name + "_updated", newFourth.getName());
+        assertEquals("second_updated", newFourth.getSecond());
+        assertEquals("third_updated", newFourth.getThird());
+        assertEquals("fourth_updated", newFourth.getFourth());
+
+        newFourth = (FourthA) SerializationUtils.clone(newFourth);
+
+        broker.beginTransaction();
+        broker.delete(newFourth);
+        broker.commitTransaction();
+
+        newFourth = (FourthA) broker.getObjectByIdentity(oid_3);
+
+        assertNull(newFourth);
+    }
+
+    public void testInheritanceViaAnonymousField_Serialized_4()
+    {
+        if(ojbSkipKnownIssueProblem("Table-per-subclass inheritance issue, when field was overridden in sub-class"))
+        {
+            return;
+        }
+        long timestamp = System.currentTimeMillis();
+        String name = "testInheritanceViaAnonymousField_4_" + timestamp;
+        String t_name = "fourth_" + name;
+
+        FourthB fourth = new FourthB(t_name);
+        fourth.setFourth("fourth");
+        fourth.setThird("third");
+        fourth.setSecond("second");
+
+        broker.beginTransaction();
+        broker.store(fourth);
+        broker.commitTransaction();
+
+        Identity oid_3 = broker.serviceIdentity().buildIdentity(fourth);
+
+        broker.clearCache();
+
+        FourthB newFourth = (FourthB) broker.getObjectByIdentity(oid_3);
+
+        assertNotNull(newFourth);
+        assertEquals(t_name, newFourth.getName());
+        assertEquals("fourth", fourth.getFourth());
+        assertEquals("third", fourth.getThird());
+        assertEquals("second", fourth.getSecond());
+
+        newFourth.setName(newFourth.getName() + "_updated");
+        newFourth.setFourth("fourth_updated");
+        newFourth.setThird("third_updated");
+        newFourth.setSecond("second_updated");
+
+        newFourth = (FourthB) SerializationUtils.clone(newFourth);
+
+        broker.beginTransaction();
+        broker.store(newFourth);
+        broker.commitTransaction();
+
+        broker.clearCache();
+
+        newFourth = (FourthB) broker.getObjectByIdentity(oid_3);
+
+        assertNotNull(newFourth);
+        assertEquals(t_name + "_updated", newFourth.getName());
+        assertEquals("second_updated", newFourth.getSecond());
+        assertEquals("third_updated", newFourth.getThird());
+        assertEquals("fourth_updated", newFourth.getFourth());
+
+        newFourth = (FourthB) SerializationUtils.clone(newFourth);
+
+        broker.beginTransaction();
+        broker.delete(newFourth);
+        broker.commitTransaction();
+
+        newFourth = (FourthB) broker.getObjectByIdentity(oid_3);
+
+        assertNull(newFourth);
+    }
+
+
 //    /**
 //     * TODO: Should we support some kind of "declarative inheritance"? This test
 //     * try to use this kind of inheritance as class Dog expects some fields from a
@@ -2380,7 +2575,7 @@
 
     public static class First implements Serializable
     {
-        private Integer id;
+        private int id;
         private String name;
 
         public First()
@@ -2392,12 +2587,12 @@
             this.name = name;
         }
 
-        public Integer getId()
+        public int getId()
         {
             return id;
         }
 
-        public void setId(Integer id)
+        public void setId(int id)
         {
             this.id = id;
         }
@@ -2415,6 +2610,19 @@
 
     public static class Second extends First
     {
+//        //!! override field not allowed !!
+//        private int id;
+//        public int getId()
+//        {
+//            return id;
+//        }
+//
+//        public void setId(int id)
+//        {
+//            this.id = id;
+//        }
+//        //!!!!!
+
         private String second;
 
         public Second()
@@ -2439,6 +2647,19 @@
 
     public static class Third extends Second
     {
+//        //!! override field not allowed !!
+//        private int id;
+//        public int getId()
+//        {
+//            return id;
+//        }
+//
+//        public void setId(int id)
+//        {
+//            this.id = id;
+//        }
+//        //!!!!!
+
         private String third;
 
         public Third()
@@ -2458,6 +2679,84 @@
         public void setThird(String third)
         {
             this.third = third;
+        }
+    }
+
+    public static class FourthA extends Third
+    {
+        //##################################
+        //!! override field to show issue !!
+        private int id;
+        public int getId()
+        {
+            return id;
+        }
+
+        public void setId(int id)
+        {
+            this.id = id;
+        }
+        //!!!!!
+        //####################################
+
+        private String fourth;
+
+        public FourthA()
+        {
+        }
+
+        public FourthA(String name)
+        {
+            super(name);
+        }
+
+        public String getFourth()
+        {
+            return fourth;
+        }
+
+        public void setFourth(String fourth)
+        {
+            this.fourth = fourth;
+        }
+    }
+
+    public static class FourthB extends Third
+    {
+        //##################################
+        //!! override field to show issue !!
+        private int id;
+        public int getId()
+        {
+            return id;
+}
+
+        public void setId(int id)
+        {
+            this.id = id;
+        }
+        //!!!!!
+        //####################################
+
+        private String fourth;
+
+        public FourthB()
+        {
+        }
+
+        public FourthB(String name)
+        {
+            super(name);
+        }
+
+        public String getFourth()
+        {
+            return fourth;
+        }
+
+        public void setFourth(String fourth)
+        {
+            this.fourth = fourth;
         }
     }
 }

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/MetaDataSerializationTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/MetaDataSerializationTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/MetaDataSerializationTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/MetaDataSerializationTest.java Fri Jan 12 10:13:08 2007
@@ -37,7 +37,8 @@
         while (it.hasNext())
         {
             ClassDescriptor cld =  (ClassDescriptor) it.next();
-            cld.getFieldDescriptorsInHeirarchy();
+
+            //cld.getFieldDescriptorsInHeirarchy();
             assertEquals(repository, cld.getRepository());
         }
     }

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/MtoNMapping.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/MtoNMapping.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/MtoNMapping.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/MtoNMapping.java Fri Jan 12 10:13:08 2007
@@ -247,7 +247,7 @@
 
             assertEquals("Same Title", p1.getTitle(), p2.getTitle());
             assertEquals("Same Number of Persons", p1.getPersons().size(), p2.getPersons().size());
-            assertEquals("Same toString", p1.getId(), p2.getId());
+            assertEquals("Same id", p1.getId(), p2.getId());
         }
     }
 

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/MultipleDBTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/MultipleDBTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/MultipleDBTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/MultipleDBTest.java Fri Jan 12 10:13:08 2007
@@ -207,7 +207,7 @@
         secPB = ojb.lookupBroker(secKey);
         secPB.clearCache();
         Object[] pks = {new Integer(fa.getId())};
-        Identity oid = new Identity(FarAwayClass.class, FarAwayClass.class, pks);
+        Identity oid = secPB.serviceIdentity().buildIdentity(FarAwayClass.class, FarAwayClass.class, pks);
         FarAwayClass fa2 = (FarAwayClass) secPB.getObjectByIdentity(oid);
         Assert.assertNotNull("Lookup for article in second DB failed", fa2);
         Assert.assertEquals(fa.toString(), fa2.toString());
@@ -259,7 +259,7 @@
         farAwayPB = ojb.lookupBroker(secKey);
         farAwayPB.clearCache();
         Object[] pks = {new Integer(fa.getId())};
-        Identity oid = new Identity(FarAwayClass.class, FarAwayClass.class, pks);
+        Identity oid = farAwayPB.serviceIdentity().buildIdentity(FarAwayClass.class, FarAwayClass.class, pks);
         FarAwayClass fa2 = (FarAwayClass) farAwayPB.getObjectByIdentity(oid);
         Assert.assertNotNull("Lookup for article in second DB failed", fa2);
         Assert.assertEquals(fa.toString(), fa2.toString());
@@ -310,7 +310,7 @@
 
         farAwayPB = ojb.lookupBroker(secKey);
         Object[] pks = {new Integer(fa.getId())};
-        Identity oid = new Identity(FarAwayClass.class, FarAwayClass.class, pks);
+        Identity oid = farAwayPB.serviceIdentity().buildIdentity(FarAwayClass.class, FarAwayClass.class, pks);
         FarAwayClass fa2 = (FarAwayClass) farAwayPB.getObjectByIdentity(oid);
         Assert.assertNotNull("Lookup for article in second DB failed", fa2);
         Assert.assertEquals(fa.toString(), fa2.toString());

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingMultithreadedTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingMultithreadedTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingMultithreadedTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingMultithreadedTest.java Fri Jan 12 10:13:08 2007
@@ -155,7 +155,7 @@
                                 + threadNumber + " waits " + counter
                                 + " times to update object. Maximal attempts before fail are " + maxAttempts
                                 + ". This can be a result of low hardware.");
-                    Thread.sleep((int) (Math.max(50, counter) * Math.random()));
+                    Thread.sleep((long) (Math.max(200, counter) * Math.random()));
                     PersistenceBroker pb = PersistenceBrokerFactory.defaultPersistenceBroker();
                     LockedByVersion temp;
                     try
@@ -201,7 +201,6 @@
             if(obj.getValue().length() < 120)
             {
                 obj.setValue(obj.getValue() + token + threadNumber);
-                //obj.setValue(obj.getValue() + token + Thread.currentThread());
             }
             else
             {

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/OptimisticLockingTest.java Fri Jan 12 10:13:08 2007
@@ -80,9 +80,9 @@
         broker.beginTransaction();
         broker.store(obj);
         broker.commitTransaction();
+        Identity oid = broker.serviceIdentity().buildIdentity(obj);
 
         broker.clearCache();
-        Identity oid = broker.serviceIdentity().buildIdentity(obj);
         LockedByVersion copy1 = (LockedByVersion) broker.getObjectByIdentity(oid);
         broker.clearCache();
         LockedByVersion copy2 = (LockedByVersion) broker.getObjectByIdentity(oid);
@@ -185,12 +185,13 @@
         LockedByTimestamp copy2 = (LockedByTimestamp) broker.getObjectByIdentity(oid);
 
         /*
-        //mysql timestamp does not support milliseconds
+        mysql timestamp does not support milliseconds
         arminw:
-        For proper test we need millisecond precision, so if mysql does not support
-        this, better we let fail this test for mysql
+        For proper test we need millisecond precision but some databases only
+        support second precision. Thus we wait 1 sec to make this test compatible
+        with most DB
         */
-        Thread.sleep(50);
+        Thread.sleep(1001);
 
         copy1.setValue("copy 1");
         copy2.setValue("copy 2");
@@ -207,6 +208,7 @@
             broker.beginTransaction();
             broker.store(copy2);
             broker.commitTransaction();
+
             fail("Should throw an Optimistic Lock exception");
         }
         catch (OptimisticLockException ex)

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java Fri Jan 12 10:13:08 2007
@@ -20,6 +20,7 @@
 import org.apache.ojb.broker.query.QueryFactory;
 import org.apache.ojb.broker.query.ReportQueryByCriteria;
 import org.apache.ojb.broker.util.ObjectModification;
+import org.apache.ojb.broker.util.GUIDFactory;
 import org.apache.ojb.junit.PBTestCase;
 
 /**
@@ -939,7 +940,8 @@
      */
     public void testGuidFieldConversion()
     {
-        GuidTestEntity gte = new GuidTestEntity();
+        String guid = new GUIDFactory().next();
+        GuidTestEntity gte = new GuidTestEntity(guid);
         broker.beginTransaction();
         broker.store(gte);
         broker.commitTransaction();

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/ProxyExamples.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/ProxyExamples.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/ProxyExamples.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/ProxyExamples.java Fri Jan 12 10:13:08 2007
@@ -88,7 +88,7 @@
 //System.out.println("now playing with product group no. 2");
         Object[] pkvals = new Object[1];
         pkvals[0] = new Integer(2);
-        Identity id = new Identity(ProductGroup.class, ProductGroup.class, pkvals);
+        Identity id = broker.serviceIdentity().buildIdentity(ProductGroup.class, ProductGroup.class, pkvals);
         InterfaceProductGroup group2 = null;
         try
         {

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/QueryTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/QueryTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/QueryTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/QueryTest.java Fri Jan 12 10:13:08 2007
@@ -39,6 +39,7 @@
 import org.apache.ojb.broker.query.QueryFactory;
 import org.apache.ojb.broker.query.ReportQuery;
 import org.apache.ojb.broker.query.ReportQueryByCriteria;
+import org.apache.ojb.broker.platforms.PlatformHsqldbImpl;
 import org.apache.ojb.junit.PBTestCase;
 
 /**
@@ -514,6 +515,7 @@
         // broker.store(p2);
         broker.store(p3);
         broker.commitTransaction();
+
         broker.clearCache();
 
         Criteria crit = new Criteria();
@@ -525,7 +527,6 @@
 
         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);
-        // TODO: Check this result, shouldn't we get 3 Project objects?
         assertEquals(2, results.size());
 
         // compare with count
@@ -548,6 +549,27 @@
     }
 
     /**
+     * test OrderBy joined column. Read all Projects
+     */
+    public void _testOrderByJoined2()
+    {
+        Criteria crit = new Criteria();
+        QueryByCriteria q = QueryFactory.newQuery(Project.class, crit);
+        q.addOrderByAscending("persons.lastname");
+
+        Collection results = broker.getCollectionByQuery(q);
+        assertNotNull(results);
+
+        // compare with count
+        int count = broker.getCount(q);
+        assertEquals(results.size(), count);
+
+        // check duplicates
+        Set resultsAsSet = new HashSet(results);
+        assertEquals(resultsAsSet.size(), results.size());
+    }
+
+    /**
      * test Subquery get all product groups without articles
      * <p/>
      * test may fail if db does not support sub queries
@@ -640,7 +662,7 @@
 
         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);
-        assertTrue(results.size() == 4);
+        assertEquals(4, results.size());
     }
 
     /**
@@ -665,7 +687,7 @@
 
         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);
-        assertTrue(results.size() == 4);
+        assertEquals(4, results.size());
     }
 
     /**
@@ -728,7 +750,7 @@
 
         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);
-        assertEquals(results.size(), 1);
+        assertEquals(1, results.size());
 
         // compare with count
         int count = broker.getCount(q);
@@ -748,7 +770,7 @@
 
         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);
-        assertEquals(results.size(), 1);
+        assertEquals(1, results.size());
 
         // compare with count
         int count = broker.getCount(q);
@@ -1014,7 +1036,7 @@
 
         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);
-        assertEquals(results.size(), 5);
+        assertEquals(5, results.size());
 
         // compare with count
         int count = broker.getCount(q);
@@ -1032,7 +1054,7 @@
 
         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);
-        assertEquals(results.size(), 3);
+        assertEquals(3, results.size());
 
         // compare with count
         int count = broker.getCount(q);
@@ -1078,7 +1100,7 @@
         while(iter.hasNext())
         {
             Object[] row = (Object[]) iter.next();
-            assertEquals(row.length, 3);
+            assertEquals(3, row.length);
 
             results.add(row);
         }
@@ -1099,15 +1121,12 @@
         Person p1 = new Person();
         p1.setFirstname("Robert");
         p1.setLastname(name);
-
         Person p2 = new Person();
         p2.setFirstname("Tom");
         p2.setLastname(name);
-
         Person p3 = new Person();
         p3.setFirstname("Roger");
         p3.setLastname(name);
-
         broker.beginTransaction();
         broker.store(p1);
         broker.store(p2);
@@ -1130,7 +1149,7 @@
         while(iter.hasNext())
         {
             Object[] row = (Object[]) iter.next();
-            assertEquals(row.length, 1);
+            assertEquals(1, row.length);
 
             results.add(row);
         }
@@ -1185,7 +1204,7 @@
         while(iter.hasNext())
         {
             Object[] row = (Object[]) iter.next();
-            assertEquals(row.length, 3);
+            assertEquals(3, row.length);
 
 //            assertEquals(row[0].getClass(), BigDecimal.class);
 //            assertEquals(row[1].getClass(), String.class);
@@ -1370,7 +1389,7 @@
         {
             results.add(iter.next());
         }
-        assertEquals(results.size(), 9);
+        assertEquals(9, results.size());
 
         // compare with count
         int count = broker.getCount(q);
@@ -1456,9 +1475,15 @@
         }
         assertTrue(results.size() > 0);
 
+        // TODO: resolve
+        if (ojbSkipKnownIssueProblem("broker.getCount() vs .getReportQueryIteratorByQuery().size()"))
+        {
+            return;
+        }
+
         // compare with count
         int count = broker.getCount(q);
-        // assertEquals(results.size(), count);   // FAILS !
+        assertEquals(results.size(), count);   // FAILS !
     }
 
     /**
@@ -1499,9 +1524,15 @@
         }
         assertTrue(results.size() > 0);
 
+        // TODO: resolve
+        if (ojbSkipKnownIssueProblem("broker.getCount() vs .getReportQueryIteratorByQuery().size()"))
+        {
+            return;
+        }
+
         // compare with count
         int count = broker.getCount(q);
-        // assertEquals(results.size(), count);   // FAILS !
+        assertEquals(results.size(), count);   // FAILS !
     }
 
     /**
@@ -1548,55 +1579,63 @@
         ClassDescriptor cldArticle = broker.getClassDescriptor(Article.class);
         Class articleProxy = cldArticle.getProxyClass();
 
-        //
-        // use ProductGroup and Articles with disabled Proxy
-        //
-        broker.clearCache();
-        cldArticle.setProxyClass(null);
+        try
+        {
+            //
+            // use ProductGroup and Articles with disabled Proxy
+            //
+            broker.clearCache();
+            cldArticle.setProxyClass(null);
 
-        Criteria crit = new Criteria();
-        crit.addLessOrEqualThan("groupId", new Integer(5));
-        QueryByCriteria q = ojb.getQueryFactory().newQuery(ProductGroupWithArray.class, crit);
-        q.addOrderByDescending("groupId");
-        q.addPrefetchedRelationship("allArticlesInGroup");
+            Criteria crit = new Criteria();
+            crit.addLessOrEqualThan("groupId", new Integer(5));
+            QueryByCriteria q = ojb.getQueryFactory().newQuery(ProductGroupWithArray.class, crit);
+            q.addOrderByDescending("groupId");
+            q.addPrefetchedRelationship("allArticlesInGroup");
 
-        Collection results = broker.getCollectionByQuery(q);
-        assertNotNull(results);
-        assertTrue(results.size() > 0);
-        ProductGroupWithArray pg = (ProductGroupWithArray) results.toArray()[0];
-        int articleSize = pg.getAllArticles().length;
-        assertTrue(articleSize != 0);
-        String articleString = Arrays.asList(pg.getAllArticles()).toString();
+            Collection results = broker.getCollectionByQuery(q);
+            assertNotNull(results);
+            assertTrue(results.size() > 0);
+            ProductGroupWithArray pg = (ProductGroupWithArray) results.toArray()[0];
+            int articleSize = pg.getAllArticles().length;
+            assertTrue(articleSize != 0);
+            String articleString = Arrays.asList(pg.getAllArticles()).toString();
 
-        //
-        // use ProductGroupWithArray and Articles with original Proxy settings
-        //
-        broker.clearCache();
-        cldArticle.setProxyClass(articleProxy);
+            //
+            // use ProductGroupWithArray and Articles with original Proxy settings
+            //
+            broker.clearCache();
+            cldArticle.setProxyClass(articleProxy);
 
 
-        crit = new Criteria();
-        crit.addEqualTo("groupId", new Integer(5));
-        q = ojb.getQueryFactory().newQuery(ProductGroupWithArray.class, crit);
-        results = broker.getCollectionByQuery(q);
-        ProductGroupWithArray pg2 = (ProductGroupWithArray) results.toArray()[0];
-        InterfaceArticle[] articles = pg2.getAllArticles();
-        assertNotNull("Array of articles should not be null!", articles);
-        assertTrue("Array should contain more than 0 entries!", articles.length != 0);
+            crit = new Criteria();
+            crit.addEqualTo("groupId", new Integer(5));
+            q = ojb.getQueryFactory().newQuery(ProductGroupWithArray.class, crit);
+            results = broker.getCollectionByQuery(q);
+            ProductGroupWithArray pg2 = (ProductGroupWithArray) results.toArray()[0];
+            InterfaceArticle[] articles = pg2.getAllArticles();
+            assertNotNull("Array of articles should not be null!", articles);
+            assertTrue("Array should contain more than 0 entries!", articles.length != 0);
 
-        // force materialization
-        for(int i = 0; i < articles.length; i++)
+            // force materialization
+            for(int i = 0; i < articles.length; i++)
+            {
+                articles[i].getArticleName();
+            }
+            int articleSize2 = articles.length;
+            String articleString2 = Arrays.asList(articles).toString();
+
+            //
+            // compare prefetched and 'normal' data
+            //
+            assertEquals("Check size", articleSize, articleSize2);
+            assertEquals("Check content", articleString, articleString2);
+        }
+        finally
         {
-            articles[i].getArticleName();
+            cldArticle.setProxyClass(articleProxy);
         }
-        int articleSize2 = articles.length;
-        String articleString2 = Arrays.asList(articles).toString();
 
-        //
-        // compare prefetched and 'normal' data
-        //
-        assertEquals("Check size", articleSize, articleSize2);
-        assertEquals("Check content", articleString, articleString2);
     }
 
     /**
@@ -1678,8 +1717,8 @@
         cldProductGroup.setProxyClassName(productGroupProxy.getName());
         cldArticle.setProxyClass(articleProxy);
         cldArticle.setProxyClassName(articleProxy.getName());
-        //broker.getDescriptorRepository().setClassDescriptor(cldProductGroup);
-        //broker.getDescriptorRepository().setClassDescriptor(cldArticle);
+        broker.getDescriptorRepository().setClassDescriptor(cldProductGroup);
+        broker.getDescriptorRepository().setClassDescriptor(cldArticle);
         }
    }
 
@@ -1736,8 +1775,8 @@
             cldProductGroup.setProxyClassName(productGroupProxy.getName());
             cldArticle.setProxyClass(articleProxy);
             cldArticle.setProxyClassName(articleProxy.getName());
-            //broker.getDescriptorRepository().setClassDescriptor(cldProductGroup);
-            //broker.getDescriptorRepository().setClassDescriptor(cldArticle);
+            broker.getDescriptorRepository().setClassDescriptor(cldProductGroup);
+            broker.getDescriptorRepository().setClassDescriptor(cldArticle);
         }
 
         crit = new Criteria();
@@ -1979,10 +2018,10 @@
         }
 
         // Groups 2, 5
-        assertEquals("check size", list.size(), 2);
+        assertEquals("check size", 2, list.size());
 
-        assertEquals("Group 2", ((InterfaceProductGroup) list.get(0)).getId().intValue(), 2);
-        assertEquals("Group 5", ((InterfaceProductGroup) list.get(1)).getId().intValue(), 5);
+        assertEquals("Group 2", 2, ((InterfaceProductGroup) list.get(0)).getId().intValue());
+        assertEquals("Group 5", 5, ((InterfaceProductGroup) list.get(1)).getId().intValue());
     }
 
     /**
@@ -2015,22 +2054,31 @@
                         assertTrue("ReportQuery result row does not contain all expected columns",
                                 columns.length == 3);
 
+            /*
+            arminw:
+            think hsql returns the wrong result or interpret the query in wrong
+            way (e.g. using hashcode of values instead values itself), so skip test
+            evaluation for this DB
+            */
+            if(!broker.serviceConnectionManager().getSupportedPlatform().getClass().equals(PlatformHsqldbImpl.class))
+            {
 //                System.out.println("### " + ((Object[]) obj)[0]
 //                        + "  " + ((Object[]) obj)[1]
 //                        + "  " + ((Object[]) obj)[2]);
-                            Object articleId = columns[2];
-                            int i = -1;
-                            if (articleId instanceof Integer) {
-                                i = ((Integer) articleId).intValue();
-                            } else if (articleId instanceof BigDecimal) {
-                                i = ((BigDecimal) articleId).intValue();
-                            } else {
-                                assertTrue("TODO: Your platforms resulting class for INTEGER (" +
-                                            articleId.getClass().getName() +
-                                            ") is not yet supported in testcase.", false);
-                            }
+                    Object articleId = columns[2];
+                    int i = -1;
+                    if (articleId instanceof Integer) {
+                        i = ((Integer) articleId).intValue();
+                    } else if (articleId instanceof BigDecimal) {
+                        i = ((BigDecimal) articleId).intValue();
+                    } else {
+                        assertTrue("TODO: Your platforms resulting class for INTEGER (" +
+                                    articleId.getClass().getName() +
+                                    ") is not yet supported in testcase.", false);
+                    }
 
-            assertTrue("i=" + i, i < 6 & i > 0);
+                assertTrue("i=" + i, i < 6 & i > 0);
+            }
         }
     }
 
@@ -2055,7 +2103,7 @@
         }
 
         // Groups: 3 Books , 1 Dairy Product
-        assertEquals("check size", list.size(), 2);
+        assertEquals("check size", 2, list.size());
     }
 
     /**
@@ -2553,15 +2601,16 @@
 
     public void testOuterJoin()
     {
+        String appendix = "_" + System.currentTimeMillis();
         Article a = new Article();
-        a.articleName = "Good stuff";
+        a.articleName = "Good stuff" + appendix;
         a.productGroup = null;
         broker.beginTransaction();
         broker.store(a);
         broker.commitTransaction();
         
         Criteria crit = new Criteria();
-        crit.addLike("articleName", "G%");
+        crit.addLike("articleName", "G%"+appendix);
         crit.addIsNull("productGroup.description");
         
         QueryByCriteria qry1 = ojb.getQueryFactory().newQuery(Article.class, crit);
@@ -2578,7 +2627,6 @@
         broker.delete(a);
         broker.commitTransaction();
     }
-    
     
     public void testExtentByInterface()
     {

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/RowReaderTestImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/RowReaderTestImpl.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/RowReaderTestImpl.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/RowReaderTestImpl.java Fri Jan 12 10:13:08 2007
@@ -11,14 +11,13 @@
 import java.util.Map;
 
 import org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl;
-import org.apache.ojb.broker.core.factory.ObjectFactory;
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 
 public class RowReaderTestImpl extends RowReaderDefaultImpl
 {
-    public RowReaderTestImpl(ObjectFactory factory, ClassDescriptor cld)
+    public RowReaderTestImpl(PersistenceConfiguration pc, ClassDescriptor cld)
     {
-        super(factory, cld);
+        super(pc, cld);
     }
 
     /**

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/UnwrapHelperTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/UnwrapHelperTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/UnwrapHelperTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/UnwrapHelperTest.java Fri Jan 12 10:13:08 2007
@@ -36,6 +36,8 @@
     private String connectionClassName = "org.hsqldb.jdbc.jdbcConnection";
     private String selectExample = "select 1 from OJB_HL_SEQ";
 
+    private static final Object[]testPattern = {"test", UnwrapHelper.TYPE_METHOD, null, null, UnwrapHelper.TYPE_METHOD, null, null};
+
     public static void main(String[] args)
     {
         String[] arr = {UnwrapHelperTest.class.getName()};
@@ -63,7 +65,7 @@
         int length = helper.getUnwrapPatterns().length;
         Object[] pattern = helper.getUnwrapPatterns()[0];
         helper.addUnwrapPattern(pattern);
-        helper.addUnwrapPattern(new Object[][]{null, null, null, null, null, null, null});
+        helper.addUnwrapPattern(testPattern);
         //System.out.println("## " + helper.toString());
         assertEquals(length + 2, helper.getUnwrapPatterns().length);
     }
@@ -125,7 +127,7 @@
 
         Object[] pattern = helper.getUnwrapPatterns()[0];
         helper.addUnwrapPattern(pattern);
-        helper.addUnwrapPattern(new Object[][]{null, null, null, null, null, null, null});
+        helper.addUnwrapPattern(testPattern);
         //System.out.println("Patterns: " + helper);
 
         t = System.currentTimeMillis();

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java?view=diff&rev=495673&r1=495672&r2=495673
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java Fri Jan 12 10:13:08 2007
@@ -5,6 +5,7 @@
 import org.apache.ojb.broker.Identity;
 import org.apache.ojb.broker.PBKey;
 import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerInternal;
 import org.apache.ojb.broker.metadata.ConnectionRepository;
 import org.apache.ojb.broker.metadata.MetadataTest;
 import org.apache.ojb.broker.metadata.ObjectCacheDescriptor;
@@ -24,7 +25,7 @@
     static final String EXCLUDE_PACKAGE = "org.apache.ojb.broker.sequence";
     static final String EXCLUDE_PACKAGE_NOT_EXIST = "org.apache.ojb.broker.sequence.xyz";
 
-    ObjectCacheDescriptor oldOcd;
+    CachingManager oldCM;
 
     public ObjectCacheTest(String s)
     {
@@ -57,8 +58,9 @@
     {
         if(broker != null) broker.close();
         persistenceConf.releaseAllInstances();
-        oldOcd = persistenceConf.getJdbcConnectionDescriptor().getObjectCacheDescriptor();
-        persistenceConf.getJdbcConnectionDescriptor().setObjectCacheDescriptor(ocd);
+        CachingManager cm = new CachingManager(ocd);
+        oldCM = persistenceConf.getCachingManager();
+        persistenceConf.setCachingManager(cm);
         broker = persistenceConf.createPersistenceBroker();
     }
 
@@ -69,48 +71,48 @@
     {
         if(broker != null) broker.close();
         persistenceConf.releaseAllInstances();
-        persistenceConf.getJdbcConnectionDescriptor().setObjectCacheDescriptor(oldOcd);
+        persistenceConf.setCachingManager(oldCM);
         broker = persistenceConf.createPersistenceBroker();
     }
 
     public void testBaseObjectCacheDefaultImpl() throws Exception
     {
-        cacheBaseFunctions(CachingStrategyDefaultImpl.class, ObjectCacheDefaultImpl.class);
+        cacheBaseFunctions(CachingPipeNoopImpl.class, ObjectCacheDefaultImpl.class);
     }
 
     public void testBaseObjectCacheJCSImpl() throws Exception
     {
-        cacheBaseFunctions(CachingStrategyDefaultImpl.class, ObjectCacheJCSImpl.class);
+        cacheBaseFunctions(CachingPipeNoopImpl.class, ObjectCacheJCSImpl.class);
     }
 
     public void testBaseObjectCacheOSCacheImpl() throws Exception
     {
-        cacheBaseFunctions(CachingStrategyDefaultImpl.class, ObjectCacheOSCacheImpl.class);
+        cacheBaseFunctions(CachingPipeNoopImpl.class, ObjectCacheOSCacheImpl.class);
     }
 
     public void testBaseObjectCacheDefaultImpl_2() throws Exception
     {
-        cacheBaseFunctions(CachingStrategyTwoLevelImpl.class, ObjectCacheDefaultImpl.class);
+        cacheBaseFunctions(CachingPipeFlatCopyImpl.class, ObjectCacheDefaultImpl.class);
     }
 
     public void testBaseObjectCacheJCSImpl_2() throws Exception
     {
-        cacheBaseFunctions(CachingStrategyTwoLevelImpl.class, ObjectCacheJCSImpl.class);
+        cacheBaseFunctions(CachingPipeFlatCopyImpl.class, ObjectCacheJCSImpl.class);
     }
 
     public void testBaseObjectCacheOSCacheImpl_2() throws Exception
     {
-        cacheBaseFunctions(CachingStrategyTwoLevelImpl.class, ObjectCacheOSCacheImpl.class);
+        cacheBaseFunctions(CachingPipeFlatCopyImpl.class, ObjectCacheOSCacheImpl.class);
     }
 
     private void cacheBaseFunctions(Class cacheStrategy, Class objectCache) throws Exception
     {
         String region =  "cacheBaseFunctions_" + objectCache.getName() + "_" + System.currentTimeMillis();
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(broker.getConfiguration().getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(cacheStrategy);
+        ocd.setCachingPreparer(cacheStrategy);
         ocd.setObjectCache(objectCache);
         ocd.setRegion(region);
-        ObjectCacheExt cache = CachingHelper.newObjectCache(ocd);
+        ObjectCache cache = CachingHelper.newObjectCache(ocd);
 
         try
         {
@@ -186,7 +188,7 @@
         String region = "cacheCompareObjectIdentityTwoLevel_" + System.currentTimeMillis();
 
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(persistenceConf.getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(CachingStrategyTwoLevelImpl.class);
+        ocd.setCachingPreparer(CachingPipeFlatCopyImpl.class);
         ocd.setObjectCache(objectCache);
         ocd.setRegion(region);
 
@@ -246,7 +248,7 @@
     public void testObjectCacheDefaultImplTimeoutAndMaxEntry() throws Exception
     {
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(broker.getConfiguration().getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(CachingStrategyDefaultImpl.class);
+        ocd.setCachingPreparer(CachingPipeNoopImpl.class);
         ocd.setObjectCache(ObjectCacheDefaultImpl.class);
         // most important setting
         ocd.setTimeout(new Integer(1));
@@ -265,7 +267,7 @@
     public void testObjectCacheJCSImplTimeoutAndMaxObjects() throws Exception
     {
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(broker.getConfiguration().getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(CachingStrategyDefaultImpl.class);
+        ocd.setCachingPreparer(CachingPipeNoopImpl.class);
         ocd.setObjectCache(ObjectCacheJCSImpl.class);
         // most important setting
         ocd.setTimeout(new Integer(1));
@@ -282,7 +284,7 @@
     public void testObjectCacheOSCacheImplTimeoutAndMaxObjects() throws Exception
     {
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(broker.getConfiguration().getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(CachingStrategyDefaultImpl.class);
+        ocd.setCachingPreparer(CachingPipeNoopImpl.class);
         ocd.setObjectCache(ObjectCacheOSCacheImpl.class);
         // most important setting
         ocd.setTimeout(new Integer(1));
@@ -294,7 +296,7 @@
     protected void timeoutMaxObjectTestFor(ObjectCacheDescriptor ocd) throws Exception
     {
         prepareNewCache(ocd);
-// System.out.println("Cache: " + broker.serviceSessionCache().getCachingStrategy(CacheObject.class));
+// System.out.println("Cache: " + broker.serviceSessionCache().getCachingPreparer(CacheObject.class));
         try
         {
             CacheObject obj_1 = new CacheObject();
@@ -360,18 +362,18 @@
     public void testJCSObjectCacheConfigFile() throws Exception
     {
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(broker.getConfiguration().getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(CachingStrategyDefaultImpl.class);
+        ocd.setCachingPreparer(CachingPipeNoopImpl.class);
         ocd.setObjectCache(ObjectCacheJCSImpl.class);
-        ObjectCacheExt cache = CachingHelper.newObjectCache(ocd);
+        ObjectCache cache = CachingHelper.newObjectCache(ocd);
 
         CacheObject obj_1 = new CacheObject(null, "testJCSPerClassObjectCacheImplementation_1");
-        Identity oid_1 = new Identity(obj_1, broker);
+        Identity oid_1 = broker.serviceIdentity().buildIdentity(obj_1);
         CacheObject obj_2 = new CacheObject(null, "testJCSPerClassObjectCacheImplementation_2");
-        Identity oid_2 = new Identity(obj_2, broker);
+        Identity oid_2 = broker.serviceIdentity().buildIdentity(obj_2);
         CacheObject obj_3 = new CacheObject(null, "testJCSPerClassObjectCacheImplementation_3");
-        Identity oid_3 = new Identity(obj_3, broker);
+        Identity oid_3 = broker.serviceIdentity().buildIdentity(obj_3);
         CacheObject obj_4 = new CacheObject(null, "testJCSPerClassObjectCacheImplementation_4");
-        Identity oid_4 = new Identity(obj_3, broker);
+        Identity oid_4 = broker.serviceIdentity().buildIdentity(obj_3);
 
         cache.cache(oid_1, obj_1);
         cache.cache(oid_2, obj_2);
@@ -418,8 +420,8 @@
         broker.store(dummy);
         broker.commitTransaction();
 
-        Identity obj_oid = new Identity(obj, broker);
-        Identity dummy_oid = new Identity(dummy, broker);
+        Identity obj_oid = broker.serviceIdentity().buildIdentity(obj);
+        Identity dummy_oid = broker.serviceIdentity().buildIdentity(dummy);
         SessionCache cache = broker.serviceSessionCache();
         Object ret_obj = cache.lookup(obj_oid);
         Object ret_dummy = cache.lookup(dummy_oid);
@@ -440,14 +442,14 @@
                 .readConnectionRepository(MetadataTest.TEST_REPOSITORY);
         ojb.getMetadataManager().mergeConnectionRepository(cr);
 
-        PersistenceBroker pb = ojb.lookupBroker(new PBKey("runtime_2"));
+        PersistenceBrokerInternal pb = ojb.lookupBroker(new PBKey("runtime_2"));
         try
         {
-            ObjectCache oc = pb.serviceSessionCache().getCachingStrategy(null).getObjectCache();
+            Connector oc = pb.serviceSessionCache().getConnector(null);
             CacheObject testObj = new CacheObject(null, name);
             Identity oid = pb.serviceIdentity().buildIdentity(testObj);
-            oc.cache(oid, testObj);
-            Object result = oc.lookup(oid);
+            oc.cache(pb, oid, testObj);
+            Object result = oc.lookup(pb, oid);
             assertNull("We should not found this object in cache", result);
         }
         finally
@@ -466,7 +468,7 @@
     {
         String name = "testCacheFilterFunctions_" + System.currentTimeMillis();
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(broker.getConfiguration().getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(CachingStrategyDefaultImpl.class);
+        ocd.setCachingPreparer(CachingPipeNoopImpl.class);
         ocd.setObjectCache(ObjectCacheDefaultImpl.class);
         ocd.setExcludedPackages(EXCLUDE_PACKAGE);
 
@@ -486,12 +488,12 @@
             Identity filterOutPackageOid = broker.serviceIdentity().buildIdentity(filterOutPackageObject);
             Identity oid = broker.serviceIdentity().buildIdentity(obj);
 
-            ObjectCache cache = broker.serviceSessionCache().getCachingStrategy(obj.getClass()).getObjectCache();
-            Object result = cache.lookup(oid);
+            Connector cache = broker.serviceSessionCache().getConnector((obj.getClass()));
+            Object result = cache.lookup(broker, oid);
             assertNotNull(result);
 
-            cache = broker.serviceSessionCache().getCachingStrategy(filterOutPackageObject.getClass()).getObjectCache();
-            result = cache.lookup(filterOutPackageOid);
+            cache = broker.serviceSessionCache().getConnector(filterOutPackageObject.getClass());
+            result = cache.lookup(broker, filterOutPackageOid);
             assertNull(result);
         }
         catch(Exception e)
@@ -514,7 +516,7 @@
         String name = "testCacheIsolation_" + System.currentTimeMillis();
 
         ObjectCacheDescriptor ocd = new ObjectCacheDescriptor(persistenceConf.getJdbcConnectionDescriptor());
-        ocd.setCachingStrategy(CachingStrategyTwoLevelImpl.class);
+        ocd.setCachingPreparer(CachingPipeFlatCopyImpl.class);
         ocd.setObjectCache(ObjectCacheDefaultImpl.class);
         // set timeout to 1 sec
         ocd.addAttribute("timeout", "1");
@@ -538,14 +540,14 @@
 
             broker_2 = persistenceConf.createPersistenceBroker();
             broker_2.beginTransaction();
-            CacheObject obj_new_2 = (CacheObject) broker_2.getObjectByQuery(QueryFactory.newQueryByIdentity(oid));
+            CacheObject obj_new_2 = (CacheObject) broker_2.getObjectByIdentity(oid);
             assertEquals(name, obj_new_2.getName());
             obj_new_2.setName(obj_new_2.getName() + "_updated");
             broker_2.store(obj_new_2);
 
             // start a second transaction
             broker.beginTransaction();
-            CacheObject obj_new = (CacheObject) broker.getObjectByQuery(QueryFactory.newQueryByIdentity(oid));
+            CacheObject obj_new = (CacheObject) broker.getObjectByIdentity(oid);
 
             assertEquals(obj.getName(), obj_new.getName());
             assertEquals(name, obj.getName());
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.