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 th...@apache.org on 2003/05/02 10:39:04 UTC
cvs commit: db-ojb/src/test/org/apache/ojb repository_junit.xml
thma 2003/05/02 01:39:04
Modified: src/test/org/apache/ojb/odmg ManyToManyTest.java
ODMGGourmet.java
src/test/org/apache/ojb repository_junit.xml
Log:
If we use ODMG persistent collections everything works fine with m:n too...
I have no idea how get these things done without using DListImpl.
IMO this would require bytecode modification as in JDO...
Revision Changes Path
1.8 +6 -4 db-ojb/src/test/org/apache/ojb/odmg/ManyToManyTest.java
Index: ManyToManyTest.java
===================================================================
RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/ManyToManyTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ManyToManyTest.java 2 Apr 2003 21:07:11 -0000 1.7
+++ ManyToManyTest.java 2 May 2003 08:39:04 -0000 1.8
@@ -376,10 +376,10 @@
/*
now we lock main object and add remove a reference object
*/
- List foodList = gourmet_doris.getFavoriteFood();
- foodList.remove(0);
tx.lock(gourmet_doris, Transaction.WRITE);
- gourmet_doris.setFavoriteFood(foodList);
+ List foodList = gourmet_doris.getFavoriteFood();
+ foodList.remove(0);
+ //gourmet_doris.setFavoriteFood(foodList);
tx.commit();
query = odmg.newOQLQuery();
@@ -393,6 +393,8 @@
assertEquals("We should found a gourmet_doris", 1, result.size());
gourmet_doris = (ODMGGourmet)result.get(0);
tx.commit();
- assertEquals(2, fishs.size());
+ assertEquals(
+ "We removed one fish, so doris should only have two entries left",
+ 2, gourmet_doris.getFavoriteFood().size());
}
}
1.2 +3 -0 db-ojb/src/test/org/apache/ojb/odmg/ODMGGourmet.java
Index: ODMGGourmet.java
===================================================================
RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/ODMGGourmet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ODMGGourmet.java 25 Jul 2002 12:45:39 -0000 1.1
+++ ODMGGourmet.java 2 May 2003 08:39:04 -0000 1.2
@@ -1,6 +1,7 @@
package org.apache.ojb.odmg;
import org.apache.ojb.broker.Gourmet;
+import org.apache.ojb.odmg.collections.DListImpl;
/**
* class used to test polymorphic m:n collections (ODMG-variant)
@@ -16,6 +17,7 @@
public ODMGGourmet()
{
super();
+ this.setFavoriteFood(new DListImpl());
}
/**
@@ -25,6 +27,7 @@
public ODMGGourmet(String name)
{
super(name);
+ this.setFavoriteFood(new DListImpl());
}
}
1.62 +1 -0 db-ojb/src/test/org/apache/ojb/repository_junit.xml
Index: repository_junit.xml
===================================================================
RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_junit.xml,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- repository_junit.xml 14 Apr 2003 16:45:34 -0000 1.61
+++ repository_junit.xml 2 May 2003 08:39:04 -0000 1.62
@@ -2459,6 +2459,7 @@
/>
<collection-descriptor
name="favoriteFood"
+ collection-class="org.apache.ojb.odmg.collections.DListImpl"
element-class-ref="org.apache.ojb.broker.InterfaceFood"
indirection-table="GOURMET_FOOD"
>