Class ParameterizedSQLBatchWritingMechanism
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
-
- org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class ParameterizedSQLBatchWritingMechanism extends BatchWritingMechanism
INTERNAL: ParameterizedSQLBatchWritingMechanism is a private class, used by the DatabaseAccessor. it provides the required behavior for batching statements, for write, with parameter binding turned on.- Since:
- OracleAS TopLink 10g (9.0.4)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseCall
lastCallAppended
protected List<List>
parameters
This variable contains a list of the parameters list passed into the queryprotected DatabaseCall
previousCall
This member variable is used to keep track of the last SQL string that was executed by this mechanism.-
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
databaseAccessor, executionCount, maxBatchSize, queryTimeoutCache, statementCount
-
-
Constructor Summary
Constructors Constructor Description ParameterizedSQLBatchWritingMechanism()
ParameterizedSQLBatchWritingMechanism(DatabaseAccessor databaseAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendCall(AbstractSession session, DatabaseCall dbCall)
INTERNAL: This method is called by the DatabaseAccessor to add this statement to the list of statements being batched.void
clear()
INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.void
executeBatchedStatements(AbstractSession session)
INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being executedDatabaseCall
getLastCallAppended()
List<List>
getParameters()
DatabaseCall
getPreviousCall()
protected PreparedStatement
prepareBatchStatements(AbstractSession session)
INTERNAL: This method is used to build the parameterized batch statement for the JDBC2.0 specificationvoid
setLastCallAppended(DatabaseCall lastCallAppended)
void
setParameters(List<List> parameters)
void
setPreviousCall(DatabaseCall previousCall)
protected void
switchMechanisms(AbstractSession session, DatabaseCall dbCall)
INTERNAL: Swaps out the Mechanism for the other Mechanism-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
cacheQueryTimeout, clearCacheQueryTimeout, clone, getMaxBatchSize, initialize, setAccessor, setMaxBatchSize
-
-
-
-
Field Detail
-
previousCall
protected DatabaseCall previousCall
This member variable is used to keep track of the last SQL string that was executed by this mechanism. If the current string and previous string match then simply bind in the arguments, otherwise end previous batch and start a new batch
-
parameters
protected List<List> parameters
This variable contains a list of the parameters list passed into the query
-
lastCallAppended
protected DatabaseCall lastCallAppended
-
-
Constructor Detail
-
ParameterizedSQLBatchWritingMechanism
public ParameterizedSQLBatchWritingMechanism()
-
ParameterizedSQLBatchWritingMechanism
public ParameterizedSQLBatchWritingMechanism(DatabaseAccessor databaseAccessor)
-
-
Method Detail
-
appendCall
public void appendCall(AbstractSession session, DatabaseCall dbCall)
INTERNAL: This method is called by the DatabaseAccessor to add this statement to the list of statements being batched. This call may result in the Mechanism executing the batched statements and possibly, switching out the mechanisms- Specified by:
appendCall
in classBatchWritingMechanism
-
clear
public void clear()
INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.- Specified by:
clear
in classBatchWritingMechanism
-
executeBatchedStatements
public void executeBatchedStatements(AbstractSession session)
INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being executed- Specified by:
executeBatchedStatements
in classBatchWritingMechanism
-
switchMechanisms
protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall)
INTERNAL: Swaps out the Mechanism for the other Mechanism
-
prepareBatchStatements
protected PreparedStatement prepareBatchStatements(AbstractSession session) throws DatabaseException
INTERNAL: This method is used to build the parameterized batch statement for the JDBC2.0 specification- Throws:
DatabaseException
-
getPreviousCall
public DatabaseCall getPreviousCall()
-
setPreviousCall
public void setPreviousCall(DatabaseCall previousCall)
-
getLastCallAppended
public DatabaseCall getLastCallAppended()
-
setLastCallAppended
public void setLastCallAppended(DatabaseCall lastCallAppended)
-
-