aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSabine Heider2013-02-21 06:18:50 (EST)
committertware2013-02-27 13:13:39 (EST)
commit8e15437c4268aef22ce136aeceb0fa996296d392 (patch)
tree5121854c9f9956199899cda5fb2fbfb57707fdc5
parent98e20c53bc6c6eaedac04c7ead8b8696d13d0787 (diff)
downloadeclipselink.runtime-8e15437c4268aef22ce136aeceb0fa996296d392.zip
eclipselink.runtime-8e15437c4268aef22ce136aeceb0fa996296d392.tar.gz
eclipselink.runtime-8e15437c4268aef22ce136aeceb0fa996296d392.tar.bz2
Fix ArrayIndexOutOfBoundsException in CascadeDeletesJUnitTestSuite
The test CascadeDeletesJUnitTestSuite.testDeletePrivateOwned fails occasionally with an ArrayIndexOutOfBoundsException. This happens when the test picks a different related entity from a OneToMany relationship that the test actually intends to. Adding an @OrderBy annotation to the relationship guarantees that always the desired entity is retrieved. Bug 401413 Signed-off-by: Sabine Heider <sabine.heider@sap.com>
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java
index 988fd4d..e55060a 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java
@@ -13,6 +13,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
import org.eclipse.persistence.annotations.PrivateOwned;
@@ -24,6 +25,7 @@ public class BranchB implements Serializable, PersistentIdentity{
@PrivateOwned
@OneToMany(fetch = LAZY, cascade = REMOVE)
+ @OrderBy("id")
protected List<BranchB> branchBs;
@ManyToMany(fetch = LAZY, cascade = REMOVE)