diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderQueryImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderQueryImpl.java index 376424f1f..ccc425c67 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderQueryImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderQueryImpl.java @@ -109,6 +109,10 @@ public class FinderQueryImpl return _sql; } + public Column[] getPKColumns() { + return _pkCols; + } + private Object[] getPKValues(OpenJPAStateManager sm, JDBCStore store) { Object[] pks = null; Object oid = sm.getObjectId(); @@ -138,12 +142,15 @@ public class FinderQueryImpl PreparedStatement stmnt = null; ResultSet rs = null; try { - stmnt = conn.prepareStatement(_sql); + stmnt = _select.prepareStatement(conn, _sql); Object[] params = getPKValues(sm, jstore); - for (int i = 0; i