mirror of https://github.com/apache/openjpa.git
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
This commit is contained in:
parent
5014430b94
commit
c26d742712
|
@ -125,7 +125,8 @@ public class PreparedStatementManagerImpl
|
||||||
sql).getMessage());
|
sql).getMessage());
|
||||||
}
|
}
|
||||||
if (autoAssignColNames != null)
|
if (autoAssignColNames != null)
|
||||||
populateAutoAssignCols(stmnt, autoAssign, row);
|
populateAutoAssignCols(stmnt, autoAssign, autoAssignColNames,
|
||||||
|
row);
|
||||||
else {
|
else {
|
||||||
StateManagerImpl sm = (StateManagerImpl)row.getPrimaryKey();
|
StateManagerImpl sm = (StateManagerImpl)row.getPrimaryKey();
|
||||||
if (sm != null) {
|
if (sm != null) {
|
||||||
|
@ -167,18 +168,19 @@ public class PreparedStatementManagerImpl
|
||||||
* sql to select the key will be issued from DBDictionary.
|
* sql to select the key will be issued from DBDictionary.
|
||||||
*/
|
*/
|
||||||
protected List populateAutoAssignCols(PreparedStatement stmnt,
|
protected List populateAutoAssignCols(PreparedStatement stmnt,
|
||||||
Column[] autoAssign, RowImpl row)
|
Column[] autoAssign, String[] autoAssignColNames, RowImpl row)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
List vals = null;
|
List vals = null;
|
||||||
if (_dict.supportsGetGeneratedKeys) {
|
if (_dict.supportsGetGeneratedKeys) {
|
||||||
// set auto assign values to id col
|
// 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;
|
return vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setObjectId(List vals, Column[] autoAssign, RowImpl row)
|
protected void setObjectId(List vals, Column[] autoAssign,
|
||||||
|
String[] autoAssignColNames, RowImpl row)
|
||||||
throws SQLException{
|
throws SQLException{
|
||||||
OpenJPAStateManager sm = row.getPrimaryKey();
|
OpenJPAStateManager sm = row.getPrimaryKey();
|
||||||
ClassMapping mapping = (ClassMapping) sm.getMetaData();
|
ClassMapping mapping = (ClassMapping) sm.getMetaData();
|
||||||
|
@ -201,12 +203,12 @@ public class PreparedStatementManagerImpl
|
||||||
* getGeneratedKeys.
|
* getGeneratedKeys.
|
||||||
*/
|
*/
|
||||||
protected List getGeneratedKeys(PreparedStatement stmnt,
|
protected List getGeneratedKeys(PreparedStatement stmnt,
|
||||||
Column[] autoAssign)
|
String[] autoAssignColNames)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
ResultSet rs = stmnt.getGeneratedKeys();
|
ResultSet rs = stmnt.getGeneratedKeys();
|
||||||
List<Object> vals = new ArrayList<Object>();
|
List<Object> vals = new ArrayList<Object>();
|
||||||
while (rs.next()) {
|
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));
|
vals.add(rs.getObject(i + 1));
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
|
|
Loading…
Reference in New Issue