Top Description Fields Constructors Methods
org.postgresql.core.v3

public Class BatchedQuery

extends SimpleQuery
Class Inheritance
Imports
org.postgresql.core.NativeQuery, .ParameterList, org.checkerframework.checker.nullness.qual.Nullable

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.
Authors
Jeremy Whiting [email protected], Christopher Deckers ([email protected])

Field Summary

Modifier and TypeField and Description
private final int
private @Nullable BatchedQuery[]
private @Nullable String
private final int
private final int
Inherited from org.postgresql.core.v3.SimpleQuery:
NO_PARAMETERS

Constructor Summary

AccessConstructor and Description
public
BatchedQuery(NativeQuery query, TypeTransferModeRegistry transferModeRegistry, int valuesBraceOpenPosition, int valuesBraceClosePosition, boolean sanitiserDisabled)

private
BatchedQuery(BatchedQuery src, int batchSize)

Method Summary

Modifier and TypeMethod and Description
private String
public BatchedQuery
deriveForMultiBatch(int valueBlock)

public int
getBatchSize()

Overrides org.postgresql.core.v3.SimpleQuery.getBatchSize.

Implements org.postgresql.core.Query.getBatchSize.

Get the number of times this Query has been batched.

public String
getNativeSql()

Overrides org.postgresql.core.v3.SimpleQuery.getNativeSql.

Implements org.postgresql.core.Query.getNativeSql.

Method to return the sql based on number of batches.

public String
Inherited from org.postgresql.core.v3.SimpleQuery:
closecreateParameterListgetBindCountgetEncodedStatementNamegetFieldsgetMaxResultRowSizegetNativeQuerygetPrepareTypesgetResultSetColumnNameIndexMapgetSqlCommandgetStatementNamegetSubquerieshasBinaryFieldshasUnresolvedTypesisEmptyisPortalDescribedisPreparedForisStatementDescribedneedUpdateFieldFormatsresetNeedUpdateFieldFormatssetCleanupRefsetFieldssetHasBinaryFieldssetPortalDescribedsetPrepareTypessetStatementDescribedsetStatementNametoStringtoStringunprepare

Field Detail

batchSizeback to summary
private final int batchSize
blocksback to summary
private @Nullable BatchedQuery[] blocks
sqlback to summary
private @Nullable String sql
valuesBraceClosePositionback to summary
private final int valuesBraceClosePosition
valuesBraceOpenPositionback to summary
private final int valuesBraceOpenPosition

Constructor Detail

BatchedQueryback to summary
public BatchedQuery(NativeQuery query, TypeTransferModeRegistry transferModeRegistry, int valuesBraceOpenPosition, int valuesBraceClosePosition, boolean sanitiserDisabled)
BatchedQueryback to summary
private BatchedQuery(BatchedQuery src, int batchSize)

Method Detail

buildNativeSqlback to summary
private String buildNativeSql(@Nullable ParameterList params)
deriveForMultiBatchback to summary
public BatchedQuery deriveForMultiBatch(int valueBlock)
getBatchSizeback to summary
public int getBatchSize()

Overrides org.postgresql.core.v3.SimpleQuery.getBatchSize.

Implements org.postgresql.core.Query.getBatchSize.

Doc from org.postgresql.core.Query.getBatchSize.

Get the number of times this Query has been batched.

Returns:int

number of times addBatch() has been called.

Annotations
@Override
getNativeSqlback to summary
public String getNativeSql()

Overrides org.postgresql.core.v3.SimpleQuery.getNativeSql.

Implements org.postgresql.core.Query.getNativeSql.

Method to return the sql based on number of batches. Skipping the initial batch.

Returns:String

Doc from org.postgresql.core.Query.getNativeSql.

SQL in native for database format

Annotations
@Override
toStringback to summary
public String toString(@Nullable ParameterList params)
Annotations
@Override