db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r367133 - in /db/ojb/branches/OJB_1_0_RELEASE/src: java/org/apache/ojb/odmg/locking/ test/org/apache/ojb/broker/cache/ test/org/apache/ojb/broker/metadata/ test/org/apache/ojb/broker/sequence/ test/org/apache/ojb/broker/sqlcount/ test/org/a...
Date Sun, 08 Jan 2006 23:59:16 GMT
Author: arminw
Date: Sun Jan  8 15:58:58 2006
New Revision: 367133

URL: http://svn.apache.org/viewcvs?rev=367133&view=rev
Log:
use IdentityFactory to create Identity objects

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/LockManagerDefaultImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/LocalCacheTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sequence/AutoIncrementTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/CollectionCountTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/EmptyCacheCountTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/SimpleCountTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/TwoLevelSimpleTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/OdmgExamples.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/RITest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/UserTestCases.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java
Sun Jan  8 15:58:58 2006
@@ -62,7 +62,7 @@
     public LockEntry getWriter(Object obj)
     {
         PersistenceBroker broker = getBroker();
-        Identity oid = new Identity(obj, broker); 
+        Identity oid = broker.serviceIdentity().buildIdentity(obj);
         return getWriter(oid);
     }
 
@@ -104,7 +104,7 @@
     public Collection getReaders(Object obj)
     {
     	checkTimedOutLocks();
-        Identity oid = new Identity(obj,getBroker());
+        Identity oid = getBroker().serviceIdentity().buildIdentity(obj);
         return getReaders(oid);
     }
 
@@ -133,7 +133,7 @@
     {
         checkTimedOutLocks();
 
-        Identity oid = new Identity(obj,getBroker());
+        Identity oid = getBroker().serviceIdentity().buildIdentity(obj);
         LockEntry reader = new LockEntry(oid.toString(),
                 tx.getGUID(),
                 System.currentTimeMillis(),
@@ -172,7 +172,7 @@
     {
         checkTimedOutLocks();
 
-        Identity oid = new Identity(obj, getBroker());
+        Identity oid = getBroker().serviceIdentity().buildIdentity(obj);
         String oidString = oid.toString();
         String txGuid = tx.getGUID();
         removeReaderInternal(oidString, txGuid);
@@ -295,7 +295,7 @@
     {
         checkTimedOutLocks();
 
-        Identity oid = new Identity(obj, tx.getBroker());
+        Identity oid = getBroker().serviceIdentity().buildIdentity(obj);
         LockEntry writer = new LockEntry(oid.toString(),
                 tx.getGUID(),
                 System.currentTimeMillis(),
@@ -339,7 +339,7 @@
     {
         checkTimedOutLocks();
 
-        Identity oid = new Identity(obj,getBroker());
+        Identity oid = getBroker().serviceIdentity().buildIdentity(obj);
         String oidString = oid.toString();
 		String txGuid = tx.getGUID();
         return hasReadLockInternal(oidString, txGuid);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/LockManagerDefaultImpl.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/LockManagerDefaultImpl.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/LockManagerDefaultImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/LockManagerDefaultImpl.java
Sun Jan  8 15:58:58 2006
@@ -60,7 +60,7 @@
      */
     public synchronized boolean readLock(TransactionImpl tx, Object obj)
     {
-        if (log.isDebugEnabled()) log.debug("LM.readLock(tx-" + tx.getGUID() + ", " + new
Identity(obj, tx.getBroker()).toString() + ")");
+        if (log.isDebugEnabled()) log.debug("LM.readLock(tx-" + tx.getGUID() + ", " + tx.getBroker().serviceIdentity().buildIdentity(obj).toString()
+ ")");
         LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
         return lockStrategy.readLock(tx, obj);
     }
@@ -76,7 +76,7 @@
      */
     public synchronized boolean writeLock(TransactionImpl tx, Object obj)
     {
-        if (log.isDebugEnabled()) log.debug("LM.writeLock(tx-" + tx.getGUID() + ", " + new
Identity(obj, tx.getBroker()).toString() + ")");
+        if (log.isDebugEnabled()) log.debug("LM.writeLock(tx-" + tx.getGUID() + ", " + tx.getBroker().serviceIdentity().buildIdentity(obj).toString()
+ ")");
         LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
         return lockStrategy.writeLock(tx, obj);
     }
@@ -93,7 +93,7 @@
      */
     public synchronized boolean upgradeLock(TransactionImpl tx, Object obj)
     {
-        if (log.isDebugEnabled()) log.debug("LM.upgradeLock(tx-" + tx.getGUID() + ", " +
new Identity(obj, tx.getBroker()).toString() + ")");
+        if (log.isDebugEnabled()) log.debug("LM.upgradeLock(tx-" + tx.getGUID() + ", " +
tx.getBroker().serviceIdentity().buildIdentity(obj).toString() + ")");
         LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
         return lockStrategy.upgradeLock(tx, obj);
     }
@@ -109,7 +109,7 @@
      */
     public synchronized boolean releaseLock(TransactionImpl tx, Object obj)
     {
-        if (log.isDebugEnabled()) log.debug("LM.releaseLock(tx-" + tx.getGUID() + ", " +
new Identity(obj, tx.getBroker()).toString() + ")");
+        if (log.isDebugEnabled()) log.debug("LM.releaseLock(tx-" + tx.getGUID() + ", " +
tx.getBroker().serviceIdentity().buildIdentity(obj).toString() + ")");
         LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
         return lockStrategy.releaseLock(tx, obj);
     }
@@ -125,7 +125,7 @@
      */
     public synchronized boolean checkRead(TransactionImpl tx, Object obj)
     {
-        if (log.isDebugEnabled()) log.debug("LM.checkRead(tx-" + tx.getGUID() + ", " + new
Identity(obj, tx.getBroker()).toString() + ")");
+        if (log.isDebugEnabled()) log.debug("LM.checkRead(tx-" + tx.getGUID() + ", " + tx.getBroker().serviceIdentity().buildIdentity(obj).toString()
+ ")");
         LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
         return lockStrategy.checkRead(tx, obj);
     }
@@ -141,7 +141,7 @@
      */
     public synchronized boolean checkWrite(TransactionImpl tx, Object obj)
     {
-        if (log.isDebugEnabled()) log.debug("LM.checkWrite(tx-" + tx.getGUID() + ", " + new
Identity(obj, tx.getBroker()).toString() + ")");
+        if (log.isDebugEnabled()) log.debug("LM.checkWrite(tx-" + tx.getGUID() + ", " + tx.getBroker().serviceIdentity().buildIdentity(obj).toString()
+ ")");
         LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
         return lockStrategy.checkWrite(tx, obj);
     }

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java
Sun Jan  8 15:58:58 2006
@@ -64,7 +64,7 @@
 	public LockEntry getWriter(Object obj)
 	{
 		PersistenceBroker broker = getBroker();
-		Identity oid = new Identity(obj, broker);
+		Identity oid = broker.serviceIdentity().buildIdentity(obj);
 		
         LockEntry result = null;
         try
@@ -148,7 +148,7 @@
 		Collection result = null;
         try
         {
-            Identity oid = new Identity(obj, getBroker());
+            Identity oid = getBroker().serviceIdentity().buildIdentity(obj);
             byte selector = (byte) 'r';
             byte[] requestBarr = buildRequestArray(oid, selector);
             
@@ -185,7 +185,7 @@
 	{
 		try
 		{
-			LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(),
+			LockEntry lock = new LockEntry(getBroker().serviceIdentity().buildIdentity(obj).toString(),
 					tx.getGUID(),
 					System.currentTimeMillis(),
 					LockStrategyFactory.getIsolationLevel(obj),
@@ -246,7 +246,7 @@
 	{
 		try
 		{
-			LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(), tx.getGUID());
+			LockEntry lock = new LockEntry(getBroker().serviceIdentity().buildIdentity(obj).toString(),
tx.getGUID());
             removeReaderRemote(lock);
 		}
 		catch (Throwable t)
@@ -382,7 +382,7 @@
 	{
 		try
 		{
-			LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(),
+			LockEntry lock = new LockEntry(getBroker().serviceIdentity().buildIdentity(obj).toString(),
 					tx.getGUID(),
 					System.currentTimeMillis(),
 					LockStrategyFactory.getIsolationLevel(obj),
@@ -434,7 +434,7 @@
 	{
 		try
 		{
-			LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(), tx.getGUID());
+			LockEntry lock = new LockEntry(getBroker().serviceIdentity().buildIdentity(obj).toString(),
tx.getGUID());
 			boolean result = hasReadLockRemote(lock);			
 			return result;
 		}

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/LocalCacheTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/LocalCacheTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/LocalCacheTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/LocalCacheTest.java
Sun Jan  8 15:58:58 2006
@@ -64,8 +64,8 @@
         broker.beginTransaction();
         broker.store(junior);
         broker.commitTransaction();
-        Identity oidJunior = new Identity(junior, broker);
-        Identity oidSenior = new Identity(junior.getFather(), broker);
+        Identity oidJunior = broker.serviceIdentity().buildIdentity(junior);
+        Identity oidSenior = broker.serviceIdentity().buildIdentity(junior.getFather());
         broker.clearCache();
 
         Criteria crit = new Criteria();
@@ -113,8 +113,8 @@
         broker.beginTransaction();
         broker.store(junior);
         broker.commitTransaction();
-        Identity oidJunior = new Identity(junior, broker);
-        Identity oidSenior = new Identity(junior.getFather(), broker);
+        Identity oidJunior = broker.serviceIdentity().buildIdentity(junior);
+        Identity oidSenior = broker.serviceIdentity().buildIdentity(junior.getFather());
 
         Criteria crit = new Criteria();
         crit.addLike("name", "jeffChild_%" + postfix);
@@ -158,8 +158,8 @@
         broker.beginTransaction();
         broker.store(junior);
         broker.commitTransaction();
-        Identity oidJunior = new Identity(junior, broker);
-        Identity oidSenior = new Identity(junior.getFather(), broker);
+        Identity oidJunior = broker.serviceIdentity().buildIdentity(junior);
+        Identity oidSenior = broker.serviceIdentity().buildIdentity(junior.getFather());
         broker.clearCache();
 
         Criteria crit = new Criteria();
@@ -221,8 +221,8 @@
         broker.beginTransaction();
         broker.store(junior);
         broker.commitTransaction();
-        Identity oidJunior = new Identity(junior, broker);
-        Identity oidSenior = new Identity(junior.getFather(), broker);
+        Identity oidJunior = broker.serviceIdentity().buildIdentity(junior);
+        Identity oidSenior = broker.serviceIdentity().buildIdentity(junior.getFather());
 
         Criteria crit = new Criteria();
         crit.addLike("name", "jeffChild_%" + postfix);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
Sun Jan  8 15:58:58 2006
@@ -82,11 +82,11 @@
             ObjectCache cache = new ObjectCacheJCSPerClassImpl(broker, null);
 
             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_2");
-            Identity oid_3 = new Identity(obj_3, broker);
+            Identity oid_3 = broker.serviceIdentity().buildIdentity(obj_3);
 
             cache.cache(oid_1, obj_1);
             cache.cache(oid_2, obj_2);
@@ -128,7 +128,7 @@
             broker.store(obj);
             broker.commitTransaction();
 
-            Identity oid = new Identity(obj, broker);
+            Identity oid = broker.serviceIdentity().buildIdentity(obj);
             obj = (TestObjectDefaultCache) broker.serviceObjectCache().lookup(oid);
             assertNotNull(obj);
 
@@ -154,7 +154,7 @@
             broker.store(obj);
             broker.commitTransaction();
 
-            Identity oid = new Identity(obj, broker);
+            Identity oid = broker.serviceIdentity().buildIdentity(obj);
             obj = (TestObjectDefaultCache) broker.serviceObjectCache().lookup(oid);
             assertNotNull(obj);
             assertEquals(name, obj.getName());
@@ -205,12 +205,12 @@
             {
                 ObjectCache cache = broker.serviceObjectCache();
                 CacheObject obj = new CacheObject(null, "CacheObject persistent obj");
-                Identity oid = new Identity(obj, broker);
+                Identity oid = broker.serviceIdentity().buildIdentity(obj);
 
 
                 Repository.SMKey filterOutPackageObject = new Repository.SMKey();
                 filterOutPackageObject.setName("ObjectCacheTest: package filter");
-                Identity filterOutPackageOid = new Identity(filterOutPackageObject, broker);
+                Identity filterOutPackageOid = broker.serviceIdentity().buildIdentity(filterOutPackageObject);
 
                 Object result = null;
                 cache.clear();
@@ -278,9 +278,9 @@
     private void checkBaseFunctions(PersistenceBroker broker, ObjectCache cache) throws Exception
     {
         CacheObject obj = new CacheObject(null, "ObjectCache test");
-        Identity oid = new Identity(obj, broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(obj);
         CacheObject obj2 = new CacheObject(null, "ObjectCache test 2");
-        Identity oid2 = new Identity(obj2, broker);
+        Identity oid2 = broker.serviceIdentity().buildIdentity(obj2);
         cache.clear();
         Object result = cache.lookup(oid);
         assertNull(result);
@@ -336,8 +336,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);
             ObjectCache cache = broker.serviceObjectCache();
             Object ret_obj = cache.lookup(obj_oid);
             Object ret_dummy = cache.lookup(dummy_oid);
@@ -368,7 +368,7 @@
         {
             ObjectCache oc = pb.serviceObjectCache();
             CacheObject testObj = new CacheObject(null, "testPerDatabaseCache");
-            Identity oid = new Identity(testObj, pb);
+            Identity oid = pb.serviceIdentity().buildIdentity(testObj);
             oc.cache(oid, testObj);
             Object result = oc.lookup(oid);
             assertNull("We should not found this object in cache", result);
@@ -387,13 +387,12 @@
      */
     public void YYYtestCacheIsolation() throws Exception
     {
+        PersistenceBroker broker1 = PersistenceBrokerFactory.defaultPersistenceBroker();
+        broker1.beginTransaction();
         Object[] pk = new Object[]{new Long(42)};
-        Identity oid = new Identity(Article.class, InterfaceArticle.class, pk);
+        Identity oid = broker1.serviceIdentity().buildIdentity(Article.class, InterfaceArticle.class,
pk);
 
         GUID guid = new GUID();
-
-        PersistenceBroker broker1 = PersistenceBrokerFactory.defaultPersistenceBroker();
-        broker1.beginTransaction();
 
         Article a1 = (Article) broker1.getObjectByQuery(new QueryByIdentity(oid));
         String originalName = a1.getArticleName();

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
Sun Jan  8 15:58:58 2006
@@ -206,7 +206,7 @@
             broker.store(compChild);
             broker.commitTransaction();
 
-            Identity oid = new Identity(compChild, broker);
+            Identity oid = broker.serviceIdentity().buildIdentity(compChild);
             broker.clearCache();
             compChild = (ObjectRepository.Component) broker.getObjectByIdentity(oid);
 

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sequence/AutoIncrementTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sequence/AutoIncrementTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sequence/AutoIncrementTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sequence/AutoIncrementTest.java
Sun Jan  8 15:58:58 2006
@@ -34,7 +34,7 @@
         assertTrue(obj_2.getIntegerId().intValue() > 0);
         assertTrue((new Integer(obj_2.getStr())).intValue() > 0);
 
-        Identity oid = new Identity(obj_2, broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(obj_2);
         IncrementObject newObj_2 = (IncrementObject) broker.getObjectByIdentity(oid);
         broker.beginTransaction();
         broker.store(obj_1);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/CollectionCountTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/CollectionCountTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/CollectionCountTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/CollectionCountTest.java
Sun Jan  8 15:58:58 2006
@@ -86,7 +86,7 @@
     myPB.clearCache();
     myPB.beginTransaction();
     ProductGroup pg =
-            (ProductGroup)myPB.getObjectByIdentity(new Identity(null, ProductGroup.class,
new Object[] {new Integer(5)}));
+            (ProductGroup)myPB.getObjectByIdentity(myPB.serviceIdentity().buildIdentity(null,
ProductGroup.class, new Object[] {new Integer(5)}));
     assertStmtCount("getObjectByIdentity", 4);
     resetStmtCount();
     List articles = pg.getAllArticles();

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/EmptyCacheCountTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/EmptyCacheCountTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/EmptyCacheCountTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/EmptyCacheCountTest.java
Sun Jan  8 15:58:58 2006
@@ -62,7 +62,7 @@
     resetStmtCount();
     myPB.clearCache();
     myPB.beginTransaction();
-    Identity id = new Identity(null, InterfaceArticle.class, new Object[] {new Integer(200)});
+    Identity id = myPB.serviceIdentity().buildIdentity(null, InterfaceArticle.class, new
Object[] {new Integer(200)});
     logger.info(id.toString());
     assertNull(id.getObjectsRealClass());
     myPB.getObjectByIdentity(id);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/SimpleCountTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/SimpleCountTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/SimpleCountTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/SimpleCountTest.java
Sun Jan  8 15:58:58 2006
@@ -27,7 +27,7 @@
     Person a = new Person();
     a.setFirstname("A");
     myPB.store(a);
-    aId = new Identity(a, myPB);
+    aId = myPB.serviceIdentity().buildIdentity(a);
     myPB.commitTransaction();
     logStmtCount("Wrote test data");
   }

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/TwoLevelSimpleTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/TwoLevelSimpleTest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/TwoLevelSimpleTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/sqlcount/TwoLevelSimpleTest.java
Sun Jan  8 15:58:58 2006
@@ -62,7 +62,7 @@
     resetStmtCount();
     pb0.clearCache();
     pb0.beginTransaction();
-    Identity id = new Identity(null, CloneableGroup.class, new Object[] {new Integer(1)});
+    Identity id = pb0.serviceIdentity().buildIdentity(null, CloneableGroup.class, new Object[]
{new Integer(1)});
     logger.info(id.toString());
     assertNull(id.getObjectsRealClass());
     Object group0 = pb0.getObjectByIdentity(id);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/OdmgExamples.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/OdmgExamples.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/OdmgExamples.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/OdmgExamples.java Sun Jan
 8 15:58:58 2006
@@ -167,7 +167,7 @@
             // 1. get OID
             Article example = new Article();
             example.setArticleId(60);
-            Identity oid = new Identity(example, ((TransactionImpl) tx).getBroker());
+            Identity oid = ((TransactionExt) tx).getBroker().serviceIdentity().buildIdentity(example);
             // 2. lookup object by OID
             PersistenceBroker broker = ((TransactionImpl) tx).getBroker();
             broker.clearCache();
@@ -348,7 +348,7 @@
             // 1. get OID
             Article example = new Article();
             example.setArticleId(30);
-            Identity oid = new Identity(example, ((TransactionImpl) tx).getBroker());
+            Identity oid = ((TransactionImpl) tx).getBroker().serviceIdentity().buildIdentity(example);
 
             // 2. lookup object by OID
             PersistenceBroker broker = ((TransactionImpl) tx).getBroker();

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/RITest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/RITest.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/RITest.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/RITest.java Sun Jan  8 15:58:58
2006
@@ -1,7 +1,11 @@
 package org.apache.ojb.odmg;
 
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
 import org.apache.ojb.broker.Contract;
-import org.apache.ojb.broker.Identity;
 import org.apache.ojb.junit.ODMGTestCase;
 import org.apache.ojb.odmg.shared.DetailFKinPK;
 import org.apache.ojb.odmg.shared.DetailFKnoPK;
@@ -10,11 +14,6 @@
 import org.odmg.OQLQuery;
 import org.odmg.Transaction;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-import java.util.List;
-
 /** Demo Application that shows basic concepts for Applications using the OJB ODMG
  * implementation as an transactional object server.
  */
@@ -97,7 +96,7 @@
         Master master = new Master();
         master.masterText = "Master_timestamp_" + timestamp;
         master.collDetailFKnoPK = new Vector();
-        new Identity(master, ((HasBroker) tx).getBroker());
+        ((TransactionExt) tx).getBroker().serviceIdentity().buildIdentity(master);
         for (int i = 0; i < countDetailObjects; i++)
         {
             DetailFKnoPK aDetail = new DetailFKnoPK();
@@ -114,7 +113,7 @@
         Master master = new Master();
         master.masterText = "Master_timestamp_" + timestamp;
         master.collDetailFKinPK = new Vector();
-        new Identity(master, ((HasBroker) tx).getBroker());
+        ((TransactionExt) tx).getBroker().serviceIdentity().buildIdentity(master);
         for (int i = 0; i < countDetailObjects; i++)
         {
             DetailFKinPK aDetail = new DetailFKinPK();

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/UserTestCases.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/UserTestCases.java?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/UserTestCases.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/UserTestCases.java Sun Jan
 8 15:58:58 2006
@@ -252,12 +252,14 @@
     {
         try
         {
+            TransactionExt txn = (TransactionExt) odmg.newTransaction();
+            txn.begin();
             // construct an id that does not exist in the database
-            Identity id = new Identity(Person.class, Person.class, new Integer[]{new Integer(-1)});
-            TransactionImpl txn = (TransactionImpl) odmg.newTransaction();
+            Identity id = txn.getBroker().serviceIdentity().buildIdentity(Person.class, Person.class,
new Integer[]{new Integer(-1)});
+            txn.commit();
             try
             {
-                txn.getObjectByIdentity(id);
+                txn.getBroker().getObjectByIdentity(id);
                 fail("expected TransactionNotInProgressException not thrown");
             }
             catch(TransactionNotInProgressException exc)



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message