Class BatchInsertStatementDefault
java.lang.Object
org.spincast.plugins.jdbc.statements.StatementBase
org.spincast.plugins.jdbc.statements.BatchInsertStatementDefault
- All Implemented Interfaces:
BatchInsertStatement
,Statement
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBatch()
protected void
addBatchParams
(Map<String, Object> params) int[]
Run the batch insert query.batchInsert
(String primaryKeyName) Run the batch insert query and return the generated ids, if the current driver supports it.protected int
Methods inherited from class org.spincast.plugins.jdbc.statements.StatementBase
addCurrentParamsToStatement, addParam, addParamsToStatement, clearParams, clearSql, clearSql, close, close, copyParamsAndStaticTokensTo, getConnection, getIndexMap, getOriginalQuery, getParams, getParsedQuery, getQueryBuilder, getSql, getSqlFormmatter, getStaticTokens, parse, setBoolean, setDate, setDouble, setFloat, setInInteger, setInLong, setInstant, setInString, setInStringFromEnumNames, setInStringFromEnumNames, setInteger, setLong, setLongList, setParams, setStaticTokens, setString, sql, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.spincast.plugins.jdbc.statements.Statement
clearSql, clearSql, getSql, setBoolean, setDate, setDouble, setFloat, setInInteger, setInLong, setInstant, setInString, setInStringFromEnumNames, setInStringFromEnumNames, setInteger, setLong, setLongList, setString, sql
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
BatchInsertStatementDefault
-
-
Method Details
-
getBatchParams
-
addBatchParams
-
addBatch
public void addBatch()- Specified by:
addBatch
in interfaceBatchInsertStatement
-
getBatchInsertSize
protected int getBatchInsertSize() -
batchInsert
public int[] batchInsert()Description copied from interface:BatchInsertStatement
Run the batch insert query. Returns the same informations as the native JDBC specs:- Specified by:
batchInsert
in interfaceBatchInsertStatement
-
batchInsert
Description copied from interface:BatchInsertStatement
Run the batch insert query and return the generated ids, if the current driver supports it.Note that some drivers don't support the return of generated keys when using batch inserts. An exception will be throwed if the generated keys cant be retrieved.
- Specified by:
batchInsert
in interfaceBatchInsertStatement
-