@@ -666,11 +666,11 @@ public <T> T query(String sql, PreparedStatementSetter pss, ResultSetExtractor<T
666
666
}
667
667
668
668
public <T > T query (String sql , Object [] args , int [] argTypes , ResultSetExtractor <T > rse ) throws DataAccessException {
669
- return query (sql , new ArgTypePreparedStatementSetter (args , argTypes ), rse );
669
+ return query (sql , newArgTypePreparedStatementSetter (args , argTypes ), rse );
670
670
}
671
671
672
672
public <T > T query (String sql , Object [] args , ResultSetExtractor <T > rse ) throws DataAccessException {
673
- return query (sql , new ArgPreparedStatementSetter (args ), rse );
673
+ return query (sql , newArgPreparedStatementSetter (args ), rse );
674
674
}
675
675
676
676
public void query (PreparedStatementCreator psc , RowCallbackHandler rch ) throws DataAccessException {
@@ -682,11 +682,11 @@ public void query(String sql, PreparedStatementSetter pss, RowCallbackHandler rc
682
682
}
683
683
684
684
public void query (String sql , Object [] args , int [] argTypes , RowCallbackHandler rch ) throws DataAccessException {
685
- query (sql , new ArgTypePreparedStatementSetter (args , argTypes ), rch );
685
+ query (sql , newArgTypePreparedStatementSetter (args , argTypes ), rch );
686
686
}
687
687
688
688
public void query (String sql , Object [] args , RowCallbackHandler rch ) throws DataAccessException {
689
- query (sql , new ArgPreparedStatementSetter (args ), rch );
689
+ query (sql , newArgPreparedStatementSetter (args ), rch );
690
690
}
691
691
692
692
public <T > List <T > query (PreparedStatementCreator psc , RowMapper <T > rowMapper ) throws DataAccessException {
@@ -843,11 +843,11 @@ public int update(String sql, PreparedStatementSetter pss) throws DataAccessExce
843
843
}
844
844
845
845
public int update (String sql , Object [] args , int [] argTypes ) throws DataAccessException {
846
- return update (sql , new ArgTypePreparedStatementSetter (args , argTypes ));
846
+ return update (sql , newArgTypePreparedStatementSetter (args , argTypes ));
847
847
}
848
848
849
849
public int update (String sql , Object ... args ) throws DataAccessException {
850
- return update (sql , new ArgPreparedStatementSetter (args ));
850
+ return update (sql , newArgPreparedStatementSetter (args ));
851
851
}
852
852
853
853
public int [] batchUpdate (String sql , final BatchPreparedStatementSetter pss ) throws DataAccessException {
@@ -1232,6 +1232,28 @@ protected void handleWarnings(SQLWarning warning) throws SQLWarningException {
1232
1232
}
1233
1233
}
1234
1234
1235
+ /**
1236
+ * Create a new ArgPreparedStatementSetter using the args passed in. This method allows the
1237
+ * creation to be overridden by sub-classes.
1238
+ * @param args object array woth arguments
1239
+ * @return the new ArgPreparedStatementSetter
1240
+ */
1241
+ protected ArgPreparedStatementSetter newArgPreparedStatementSetter (Object [] args ) {
1242
+ return new ArgPreparedStatementSetter (args );
1243
+ }
1244
+
1245
+ /**
1246
+ * Create a new ArgTypePreparedStatementSetter using the args and argTypes passed in.
1247
+ * This method allows the creation to be overridden by sub-classes.
1248
+ * @param args object array woth arguments
1249
+ * @param argTypes int array of SQLTypes for arguments
1250
+ * @return the new ArgTypePreparedStatementSetter
1251
+ */
1252
+ protected ArgTypePreparedStatementSetter newArgTypePreparedStatementSetter (Object [] args , int [] argTypes ) {
1253
+ return new ArgTypePreparedStatementSetter (args , argTypes );
1254
+ }
1255
+
1256
+
1235
1257
/**
1236
1258
* Determine SQL from potential provider object.
1237
1259
* @param sqlProvider object that's potentially a SqlProvider
0 commit comments