Class BatchedQuery
java.lang.Object
org.postgresql.core.v3.SimpleQuery
org.postgresql.core.v3.BatchedQuery
- All Implemented Interfaces:
Query
Purpose of this object is to support batched query re write behaviour. Responsibility for
tracking the batch size and implement the clean up of the query fragments after the batch execute
is complete. Intended to be used to wrap a Query that is present in the batchStatements
collection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate BatchedQuery[]private Stringprivate final intprivate final intFields inherited from class SimpleQuery
NO_PARAMETERS -
Constructor Summary
ConstructorsModifierConstructorDescriptionBatchedQuery(NativeQuery query, TypeTransferModeRegistry transferModeRegistry, int valuesBraceOpenPosition, int valuesBraceClosePosition, boolean sanitiserDisabled) privateBatchedQuery(BatchedQuery src, int batchSize) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringbuildNativeSql(ParameterList params, SqlSerializationContext context) deriveForMultiBatch(int valueBlock) intGet the number of times this Query has been batched.Method to return the sql based on number of batches.toString(ParameterList params, SqlSerializationContext context) Returns string representation of the query, substituting particular parameter values for parameter placeholders.Methods inherited from class SimpleQuery
close, createParameterList, getBindCount, getEncodedStatementName, getFields, getMaxResultRowSize, getNativeQuery, getPrepareTypes, getResultSetColumnNameIndexMap, getSqlCommand, getStatementName, getSubqueries, hasBinaryFields, hasUnresolvedTypes, isEmpty, isPortalDescribed, isPreparedFor, isStatementDescribed, needUpdateFieldFormats, resetNeedUpdateFieldFormats, setCleanupRef, setFields, setHasBinaryFields, setPortalDescribed, setPrepareTypes, setStatementDescribed, setStatementName, toString, toString, unprepare
-
Field Details
-
sql
-
valuesBraceOpenPosition
private final int valuesBraceOpenPosition -
valuesBraceClosePosition
private final int valuesBraceClosePosition -
batchSize
private final int batchSize -
blocks
-
-
Constructor Details
-
BatchedQuery
public BatchedQuery(NativeQuery query, TypeTransferModeRegistry transferModeRegistry, int valuesBraceOpenPosition, int valuesBraceClosePosition, boolean sanitiserDisabled) -
BatchedQuery
-
-
Method Details
-
deriveForMultiBatch
-
getBatchSize
public int getBatchSize()Description copied from interface:QueryGet the number of times this Query has been batched.- Specified by:
getBatchSizein interfaceQuery- Overrides:
getBatchSizein classSimpleQuery- Returns:
- number of times
addBatch()has been called.
-
getNativeSql
Method to return the sql based on number of batches. Skipping the initial batch.- Specified by:
getNativeSqlin interfaceQuery- Overrides:
getNativeSqlin classSimpleQuery- Returns:
- SQL in native for database format
-
buildNativeSql
-
toString
Description copied from interface:QueryReturns string representation of the query, substituting particular parameter values for parameter placeholders.- Specified by:
toStringin interfaceQuery- Overrides:
toStringin classSimpleQuery- Parameters:
params- a ParameterList returned by this Query'sQuery.createParameterList()method, ornullto leave the parameter placeholders unsubstituted.context- specifies configuration for converting the parameters to string- Returns:
- string representation of this query
-