public class BatchUpdateOperator extends AbstractOperator implements IBatchUpdateOperator
executed, expenseTime, sql
Constructor and Description |
---|
BatchUpdateOperator(IDatabaseConnectionHolder connectionHolder) |
BatchUpdateOperator(IDatabaseConnectionHolder connectionHolder,
IAccessorConfig accessorConfig) |
BatchUpdateOperator(String sql,
IDatabaseConnectionHolder connectionHolder) |
BatchUpdateOperator(String sql,
IDatabaseConnectionHolder connectionHolder,
IAccessorConfig accessorConfig) |
Modifier and Type | Method and Description |
---|---|
IBatchUpdateOperator |
addBatchParameter(SQLBatchParameter parameter)
添加批量SQL参数
|
IBatchUpdateOperator |
addBatchSQL(String sql)
添加SQL语句
|
IOperator |
addParameter(Object parameter)
添加SQL参数,若参数为NULL则将默认向SQL传递NULL值对象
|
IOperator |
addParameter(SQLParameter parameter)
添加SQL参数,若参数为NULL则忽略
|
protected int |
doExecute()
执行具体的操作过程
|
List<SQLBatchParameter> |
getBatchParameters()
获取批量SQL参数集合
|
int[] |
getEffectCounts()
对于 INSERT、UPDATE 或 DELETE 语句,返回行数; 对于无返回结果的SQL语句,返回 0
|
int |
getEffectCountsTotal()
获取累计受影响的总记录数
|
List<SQLParameter> |
getParameters()
获取SQL参数集合
|
static int |
parseEffectCounts(int[] effectCounts) |
protected String |
serializeParameters() |
doAppendStackTraces, doSetParameters, execute, getAccessorConfig, getConnectionHolder, getExpenseTime, getSQL, isExecuted, setAccessorConfig
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, getAccessorConfig, getConnectionHolder, getExpenseTime, getSQL, isExecuted, setAccessorConfig
public BatchUpdateOperator(IDatabaseConnectionHolder connectionHolder)
public BatchUpdateOperator(IDatabaseConnectionHolder connectionHolder, IAccessorConfig accessorConfig)
public BatchUpdateOperator(String sql, IDatabaseConnectionHolder connectionHolder)
public BatchUpdateOperator(String sql, IDatabaseConnectionHolder connectionHolder, IAccessorConfig accessorConfig)
public static int parseEffectCounts(int[] effectCounts)
protected String serializeParameters()
serializeParameters
in class AbstractOperator
protected int doExecute() throws Exception
AbstractOperator
doExecute
in class AbstractOperator
Exception
- 执行过程中产生的异常public int[] getEffectCounts()
IBatchUpdateOperator
getEffectCounts
in interface IBatchUpdateOperator
public int getEffectCountsTotal()
IBatchUpdateOperator
getEffectCountsTotal
in interface IBatchUpdateOperator
public IBatchUpdateOperator addBatchSQL(String sql)
IBatchUpdateOperator
addBatchSQL
in interface IBatchUpdateOperator
sql
- SQL语句public IBatchUpdateOperator addBatchParameter(SQLBatchParameter parameter)
IBatchUpdateOperator
addBatchParameter
in interface IBatchUpdateOperator
parameter
- 批量SQL参数对象public List<SQLBatchParameter> getBatchParameters()
IBatchUpdateOperator
getBatchParameters
in interface IBatchUpdateOperator
public IOperator addParameter(Object parameter)
IOperator
addParameter
in interface IOperator
addParameter
in class AbstractOperator
parameter
- SQL参数值public IOperator addParameter(SQLParameter parameter)
IOperator
addParameter
in interface IOperator
addParameter
in class AbstractOperator
parameter
- SQL参数对象public List<SQLParameter> getParameters()
IOperator
getParameters
in interface IOperator
getParameters
in class AbstractOperator
Copyright © 2022. All rights reserved.