You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2005/09/03 20:14:45 UTC
cvs commit: db-ojb/src/test/org/apache/ojb/broker MtoNMapping.java
arminw 2005/09/03 11:14:45
Modified: src/test/org/apache/ojb/broker MtoNMapping.java
Log:
fix identity creation
Revision Changes Path
1.29 +9 -7 db-ojb/src/test/org/apache/ojb/broker/MtoNMapping.java
Index: MtoNMapping.java
===================================================================
RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/MtoNMapping.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- MtoNMapping.java 25 Mar 2005 19:06:28 -0000 1.28
+++ MtoNMapping.java 3 Sep 2005 18:14:45 -0000 1.29
@@ -37,9 +37,7 @@
public void testPolymorphMToN()
{
Gourmet james = new Gourmet("james");
- Identity jamesId = new Identity(james, broker);
Gourmet doris = new Gourmet("doris");
- Identity dorisId = new Identity(doris, broker);
Fish tuna = new Fish("tuna", 242, "salt");
Fish trout = new Fish("trout", 52, "fresh water");
@@ -59,6 +57,9 @@
broker.store(doris);
broker.commitTransaction();
+ Identity jamesId = broker.serviceIdentity().buildIdentity(james);
+ Identity dorisId = broker.serviceIdentity().buildIdentity(doris);
+
broker.clearCache();
Gourmet loadedJames = (Gourmet) broker.getObjectByIdentity(jamesId);
@@ -74,9 +75,7 @@
{
long timestamp = System.currentTimeMillis();
Gourmet james = new Gourmet("james");
- Identity jamesId = new Identity(james, broker);
Gourmet doris = new Gourmet("doris");
- Identity dorisId = new Identity(doris, broker);
Fish tuna = new Fish("tuna", 242, "salt");
Fish trout = new Fish("trout", 52, "fresh water");
@@ -97,6 +96,9 @@
broker.store(doris);
broker.commitTransaction();
+ Identity jamesId = broker.serviceIdentity().buildIdentity(james);
+ Identity dorisId = broker.serviceIdentity().buildIdentity(doris);
+
broker.clearCache();
Gourmet loadedJames = (Gourmet) broker.getObjectByIdentity(jamesId);
@@ -126,9 +128,7 @@
{
long timestamp = System.currentTimeMillis();
Gourmet james = new Gourmet("james_" + timestamp);
- Identity jamesId = new Identity(james, broker);
Gourmet doris = new Gourmet("doris_" + timestamp);
- Identity dorisId = new Identity(doris, broker);
Fish tuna = new Fish("tuna_" + timestamp, 242, "salt");
Fish trout = new Fish("trout_" + timestamp, 52, "fresh water");
@@ -148,9 +148,11 @@
broker.beginTransaction();
broker.store(james);
broker.store(doris);
-
broker.commitTransaction();
+ Identity jamesId = broker.serviceIdentity().buildIdentity(james);
+ Identity dorisId = broker.serviceIdentity().buildIdentity(doris);
+
broker.clearCache();
Gourmet loadedJames = (Gourmet) broker.getObjectByIdentity(jamesId);
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org