diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java index 0c3ebbc1f..878c1cf26 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java @@ -249,7 +249,7 @@ public class SubqueryImpl extends ExpressionImpl implements Subquery { // should be the class metadata of the collection element private ClassMetaData getCandidate() { RootImpl root = (RootImpl)getRoot(); - RootImpl correlatedRoot = (RootImpl)root.getCorrelatedParent(); + PathImpl correlatedRoot = root.getCorrelatedParent(); if (correlatedRoot != null && root.getJoins() != null) { Join join = root.getJoins().iterator().next(); FieldMetaData fmd = ((Members.Member)join.getAttribute()).fmd;