Package org.postgresql.core.v3
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 org.postgresql.core.v3.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) 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) Stringize this query to a human-readable form, substituting particular parameter values for parameter placeholders.Methods inherited from class org.postgresql.core.v3.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, 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:QueryStringize this query to a human-readable form, 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.- Returns:
- a human-readable representation of this query
-