db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [db-jdo] 33/43: JDO-426: update both sides of the employee<->project relationship
Date Fri, 07 May 2021 23:12:15 GMT
This is an automated email from the ASF dual-hosted git repository.

clr pushed a commit to branch origin/2.0.1
in repository https://gitbox.apache.org/repos/asf/db-jdo.git

commit 44e933ac9502c5618243199df18c4d72061930a0
Author: Michael Bouschen <mbo@apache.org>
AuthorDate: Wed Oct 4 19:36:15 2006 +0000

    JDO-426: update both sides of the employee<->project relationship
---
 .../jdo/tck/query/jdoql/NullCollectionsAndContainsMethod.java       | 5 +++++
 .../org/apache/jdo/tck/query/jdoql/NullCollectionsAndIsEmpty.java   | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndContainsMethod.java
b/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndContainsMethod.java
index 841ac13..8b34a42 100644
--- a/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndContainsMethod.java
+++ b/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndContainsMethod.java
@@ -16,6 +16,8 @@
 
 package org.apache.jdo.tck.query.jdoql;
 
+import java.util.Iterator;
+
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.Employee;
@@ -126,6 +128,9 @@ public class NullCollectionsAndContainsMethod extends QueryTest {
         loadAndPersistCompanyModel(getPM());
         getPM().currentTransaction().begin();
         Employee emp1 = (Employee) getPersistentCompanyModelInstance("emp1");
+        for (Iterator itr = emp1.getProjects().iterator(); itr.hasNext();) {
+            ((Project) itr.next()).removeMember(emp1); 
+        }
         emp1.setProjects(null);
         getPM().currentTransaction().commit();
     }
diff --git a/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndIsEmpty.java
b/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndIsEmpty.java
index d128d72..1257d06 100644
--- a/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndIsEmpty.java
+++ b/tck20/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndIsEmpty.java
@@ -16,9 +16,12 @@
 
 package org.apache.jdo.tck.query.jdoql;
 
+import java.util.Iterator;
+
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.pc.company.Project;
 import org.apache.jdo.tck.query.QueryElementHolder;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
@@ -98,6 +101,9 @@ public class NullCollectionsAndIsEmpty extends QueryTest {
         loadAndPersistCompanyModel(getPM());
         getPM().currentTransaction().begin();
         Employee emp1 = (Employee) getPersistentCompanyModelInstance("emp1");
+        for (Iterator itr = emp1.getProjects().iterator(); itr.hasNext();) {
+            ((Project) itr.next()).removeMember(emp1); 
+        }
         emp1.setProjects(null);
         getPM().currentTransaction().commit();
     }

Mime
View raw message