Class InsertExecutionImpl
- java.lang.Object
-
- org.teiid.translator.salesforce.execution.AbstractUpdateExecution
-
- org.teiid.translator.salesforce.execution.InsertExecutionImpl
-
- All Implemented Interfaces:
Execution
,UpdateExecution
public class InsertExecutionImpl extends AbstractUpdateExecution
-
-
Field Summary
-
Fields inherited from class org.teiid.translator.salesforce.execution.AbstractUpdateExecution
command, connection, context, executionFactory, metadata, result
-
-
Constructor Summary
Constructors Constructor Description InsertExecutionImpl(SalesForceExecutionFactory ef, Command command, SalesforceConnection salesforceConnection, RuntimeMetadata metadata, ExecutionContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<com.sforce.async.SObject>
buildBulkRowPayload(Insert insert, Iterator<? extends List<?>> it, int rowCount)
void
cancel()
Cancels the execution abnormally.void
execute()
Execute the associated command.int[]
getUpdateCounts()
Returns the update counts for the execution.-
Methods inherited from class org.teiid.translator.salesforce.execution.AbstractUpdateExecution
close, getConnection, getMetadata, processIds
-
-
-
-
Constructor Detail
-
InsertExecutionImpl
public InsertExecutionImpl(SalesForceExecutionFactory ef, Command command, SalesforceConnection salesforceConnection, RuntimeMetadata metadata, ExecutionContext context) throws TranslatorException
- Throws:
TranslatorException
-
-
Method Detail
-
execute
public void execute() throws TranslatorException
Description copied from interface:Execution
Execute the associated command. Results will be retrieved through a specific sub-interface call.- Throws:
TranslatorException
-
buildBulkRowPayload
protected List<com.sforce.async.SObject> buildBulkRowPayload(Insert insert, Iterator<? extends List<?>> it, int rowCount) throws TranslatorException
- Throws:
TranslatorException
-
getUpdateCounts
public int[] getUpdateCounts() throws DataNotAvailableException, TranslatorException
Description copied from interface:UpdateExecution
Returns the update counts for the execution.
A single positive integer value is expected for non bulk/batch commands.
bulk/batch should return an integer for each value/command. 0 or greater for successful update count, -2 for no info, -3 failure- Specified by:
getUpdateCounts
in interfaceUpdateExecution
- Overrides:
getUpdateCounts
in classAbstractUpdateExecution
- Returns:
- the update counts corresponding to the command executed
- Throws:
DataNotAvailableException
TranslatorException
-
cancel
public void cancel() throws TranslatorException
Description copied from interface:Execution
Cancels the execution abnormally. This will happen via a different thread from the one performing the execution, so should be expected to happen in a multi-threaded scenario.- Specified by:
cancel
in interfaceExecution
- Overrides:
cancel
in classAbstractUpdateExecution
- Throws:
TranslatorException
-
-