From b612d646209bc72c0948a8f7e6d03527a6bdb3cd Mon Sep 17 00:00:00 2001 From: Fay Wang Date: Sat, 7 Mar 2009 00:40:53 +0000 Subject: [PATCH] OPENJPA-965: Open up FinderCacheImpl for jdbc and non-jdbc like implementation git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@751148 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/jdbc/kernel/FinderQueryImpl.java | 15 ++++++++++---- .../apache/openjpa/jdbc/sql/SelectImpl.java | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) 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