public.javadoc.org.spincast.plugins.jdbc.statements.BatchInsertStatementDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
BatchInsertStatementDefault (org.spincast:spincast-framework 1.0.0 API)
org.spincast.plugins.jdbc.statements
Class BatchInsertStatementDefault
- java.lang.Object
-
- org.spincast.plugins.jdbc.statements.StatementBase
-
- org.spincast.plugins.jdbc.statements.BatchInsertStatementDefault
-
- All Implemented Interfaces:
- BatchInsertStatement, Statement
public class BatchInsertStatementDefault
extends StatementBase
implements BatchInsertStatement
-
-
Field Summary
Fields
Modifier and Type
Field and Description
protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors
Constructor and Description
BatchInsertStatementDefault(Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
void
addBatch()
protected void
addBatchParams(Map<String,Object> params)
int[]
batchInsert()
Run the batch insert query.
List<Long>
batchInsert(String primaryKeyName)
Run the batch insert query and return the generated ids, if
the current driver supports it.
protected int
getBatchInsertSize()
protected List<Map<String,Object>>
getBatchParams()
-
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
-
-
Constructor Detail
-
BatchInsertStatementDefault
public BatchInsertStatementDefault(Connection connection)
-
Method Detail
-
addBatch
public void addBatch()
- Specified by:
addBatch
in interface BatchInsertStatement
-
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 interface BatchInsertStatement
- See Also:
https://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#executeBatch()
-
batchInsert
public List<Long> batchInsert(String primaryKeyName)
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 interface BatchInsertStatement
Copyright © 2019. All rights reserved.