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

pack-priv Class CompositeQuery

extends Object
implements Query
Class Inheritance
All Implemented Interfaces
org.postgresql.core.Query
Imports
org.postgresql.core.ParameterList, .Query, .SqlCommand, org.checkerframework.checker.nullness.qual.Nullable, java.util.Map

V3 Query implementation for queries that involve multiple statements. We split it up into one SimpleQuery per statement, and wrap the corresponding per-statement SimpleParameterList objects in a CompositeParameterList.
Author
Oliver Jowett ([email protected])

Field Summary

Modifier and TypeField and Description
private final int[]
private final SimpleQuery[]

Constructor Summary

AccessConstructor and Description
pack-priv
CompositeQuery(SimpleQuery[] subqueries, int[] offsets)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.postgresql.core.Query.close.

Close this query and free any server-side resources associated with it.

public ParameterList
createParameterList()

Implements org.postgresql.core.Query.createParameterList.

Create a ParameterList suitable for storing parameters associated with this Query.

public int
getBatchSize()

Implements org.postgresql.core.Query.getBatchSize.

Get the number of times this Query has been batched.

public String
getNativeSql()

Implements org.postgresql.core.Query.getNativeSql.

Returns SQL in native for database format.

public @Nullable Map<String, Integer>
getResultSetColumnNameIndexMap()

Implements org.postgresql.core.Query.getResultSetColumnNameIndexMap.

Get a map that a result set can use to find the index associated to a name.

public @Nullable SqlCommand
getSqlCommand()

Implements org.postgresql.core.Query.getSqlCommand.

Returns properties of the query (sql keyword, and some other parsing info).

public Query[]
getSubqueries()

Implements org.postgresql.core.Query.getSubqueries.

Return a list of the Query objects that make up this query.

public boolean
public boolean
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

offsetsback to summary
private final int[] offsets
subqueriesback to summary
private final SimpleQuery[] subqueries

Constructor Detail

CompositeQueryback to summary
pack-priv CompositeQuery(SimpleQuery[] subqueries, int[] offsets)

Method Detail

closeback to summary
public void close()

Implements org.postgresql.core.Query.close.

Doc from org.postgresql.core.Query.close.

Close this query and free any server-side resources associated with it. The resources may not be immediately deallocated, but closing a Query may make the deallocation more prompt.

A closed Query should not be executed.

Annotations
@Override
createParameterListback to summary
public ParameterList createParameterList()

Implements org.postgresql.core.Query.createParameterList.

Doc from org.postgresql.core.Query.createParameterList.

Create a ParameterList suitable for storing parameters associated with this Query.

If this query has no parameters, a ParameterList will be returned, but it may be a shared immutable object. If this query does have parameters, the returned ParameterList is a new list, unshared by other callers.

Returns:ParameterList

a suitable ParameterList instance for this query

Annotations
@Override
getBatchSizeback to summary
public int 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()

Implements org.postgresql.core.Query.getNativeSql.

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

Returns SQL in native for database format.

Returns:String

SQL in native for database format

Annotations
@Override
getResultSetColumnNameIndexMapback to summary
public @Nullable Map<String, Integer> getResultSetColumnNameIndexMap()

Implements org.postgresql.core.Query.getResultSetColumnNameIndexMap.

Doc from org.postgresql.core.Query.getResultSetColumnNameIndexMap.

Get a map that a result set can use to find the index associated to a name.

Returns:@Nullable Map<String, Integer>

null if the query implementation does not support this method.

Annotations
@Override
getSqlCommandback to summary
public @Nullable SqlCommand getSqlCommand()

Implements org.postgresql.core.Query.getSqlCommand.

Doc from org.postgresql.core.Query.getSqlCommand.

Returns properties of the query (sql keyword, and some other parsing info).

Returns:@Nullable SqlCommand

returns properties of the query (sql keyword, and some other parsing info) or null if not applicable

Annotations
@Override
getSubqueriesback to summary
public Query[] getSubqueries()

Implements org.postgresql.core.Query.getSubqueries.

Doc from org.postgresql.core.Query.getSubqueries.

Return a list of the Query objects that make up this query. If this object is already a SimpleQuery, returns null (avoids an extra array construction in the common case).

Returns:Query[]

an array of single-statement queries, or null if this object is already a single-statement query.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements org.postgresql.core.Query.isEmpty.

Annotations
@Override
isStatementDescribedback to summary
public boolean isStatementDescribed()

Implements org.postgresql.core.Query.isStatementDescribed.

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

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override