From c26d742712eb14ecab3fe54660d66ad56309133f Mon Sep 17 00:00:00 2001 From: Milosz Tylenda Date: Mon, 11 May 2009 19:51:39 +0000 Subject: [PATCH] OPENJPA-736: Restore method signatures per Albert's request git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@773666 13f79535-47bb-0310-9956-ffa450edef68 --- .../kernel/PreparedStatementManagerImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java index 8a8f54306..662625fbf 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java @@ -125,7 +125,8 @@ public class PreparedStatementManagerImpl sql).getMessage()); } if (autoAssignColNames != null) - populateAutoAssignCols(stmnt, autoAssign, row); + populateAutoAssignCols(stmnt, autoAssign, autoAssignColNames, + row); else { StateManagerImpl sm = (StateManagerImpl)row.getPrimaryKey(); if (sm != null) { @@ -167,18 +168,19 @@ public class PreparedStatementManagerImpl * sql to select the key will be issued from DBDictionary. */ protected List populateAutoAssignCols(PreparedStatement stmnt, - Column[] autoAssign, RowImpl row) + Column[] autoAssign, String[] autoAssignColNames, RowImpl row) throws SQLException { List vals = null; if (_dict.supportsGetGeneratedKeys) { // set auto assign values to id col - vals = getGeneratedKeys(stmnt, autoAssign); + vals = getGeneratedKeys(stmnt, autoAssignColNames); } - setObjectId(vals, autoAssign, row); + setObjectId(vals, autoAssign, autoAssignColNames, row); return vals; } - protected void setObjectId(List vals, Column[] autoAssign, RowImpl row) + protected void setObjectId(List vals, Column[] autoAssign, + String[] autoAssignColNames, RowImpl row) throws SQLException{ OpenJPAStateManager sm = row.getPrimaryKey(); ClassMapping mapping = (ClassMapping) sm.getMetaData(); @@ -201,12 +203,12 @@ public class PreparedStatementManagerImpl * getGeneratedKeys. */ protected List getGeneratedKeys(PreparedStatement stmnt, - Column[] autoAssign) + String[] autoAssignColNames) throws SQLException { ResultSet rs = stmnt.getGeneratedKeys(); List vals = new ArrayList(); while (rs.next()) { - for (int i = 0; i < autoAssign.length; i++) + for (int i = 0; i < autoAssignColNames.length; i++) vals.add(rs.getObject(i + 1)); } rs.close();