mirror of https://github.com/apache/openjpa.git
1035 JPA2 Query fix setParameter for key path in predicates
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@766576 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4d1b86e860
commit
32fd2a52d1
|
@ -32,7 +32,6 @@ import org.apache.openjpa.jdbc.meta.FieldMapping;
|
||||||
import org.apache.openjpa.jdbc.meta.Strategy;
|
import org.apache.openjpa.jdbc.meta.Strategy;
|
||||||
import org.apache.openjpa.jdbc.meta.ValueMapping;
|
import org.apache.openjpa.jdbc.meta.ValueMapping;
|
||||||
import org.apache.openjpa.jdbc.meta.strats.HandlerCollectionTableFieldStrategy;
|
import org.apache.openjpa.jdbc.meta.strats.HandlerCollectionTableFieldStrategy;
|
||||||
import org.apache.openjpa.jdbc.meta.strats.HandlerRelationMapTableFieldStrategy;
|
|
||||||
import org.apache.openjpa.jdbc.meta.strats.LRSMapFieldStrategy;
|
import org.apache.openjpa.jdbc.meta.strats.LRSMapFieldStrategy;
|
||||||
import org.apache.openjpa.jdbc.schema.Column;
|
import org.apache.openjpa.jdbc.schema.Column;
|
||||||
import org.apache.openjpa.jdbc.schema.ForeignKey;
|
import org.apache.openjpa.jdbc.schema.ForeignKey;
|
||||||
|
|
|
@ -1273,7 +1273,7 @@ public class JPQLExpressionBuilder
|
||||||
if (fmd == null)
|
if (fmd == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Class type = path.isXPath() ? path.getType() : fmd.getDeclaredType();
|
Class type = path.getType();
|
||||||
if (type == null)
|
if (type == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,15 @@ public class TestMany2ManyMapEx2 extends SQLListenerTestCase {
|
||||||
rs = q.getResultList();
|
rs = q.getResultList();
|
||||||
assertEquals((String) rs.get(0), "String1");
|
assertEquals((String) rs.get(0), "String1");
|
||||||
|
|
||||||
|
query = "select KEY(e) from PhoneNumber p, " +
|
||||||
|
" in (p.emps) e WHERE KEY(e) = ?1";
|
||||||
|
q = em.createQuery(query);
|
||||||
|
q.setParameter(1, "String1");
|
||||||
|
if (inMemory)
|
||||||
|
setCandidate(q, PhoneNumber.class);
|
||||||
|
rs = q.getResultList();
|
||||||
|
assertEquals((String) rs.get(0), "String1");
|
||||||
|
|
||||||
em.close();
|
em.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue