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:
Catalina Wei 2009-04-20 05:21:40 +00:00
parent 4d1b86e860
commit 32fd2a52d1
3 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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();
} }