Top Description Inners Fields Constructors Methods
org.h2.command

public Class CommandContainer

extends Command
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .Set, org.h2.api.DatabaseEventListener, .ErrorCode, org.h2.command.dml.DataChangeStatement, org.h2.engine.Database, .DbObject, .DbSettings, .SessionLocal, org.h2.expression.Expression, .ExpressionColumn, .Parameter, .ParameterInterface, org.h2.index.Index, org.h2.message.DbException, org.h2.result.LocalResult, .ResultInterface, .ResultTarget, .ResultWithGeneratedKeys, org.h2.table.Column, .DataChangeDeltaTable.ResultOption, .Table, org.h2.util.StringUtils, .Utils, org.h2.value.Value

Represents a single SQL statements. It wraps a prepared statement.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
CommandContainer.GeneratedKeysCollector

Collector of generated keys.

Field Summary

Modifier and TypeField and Description
private Prepared
private boolean
private boolean
Inherited from org.h2.command.Command:
sessionstartTimeNanos

Constructor Summary

AccessConstructor and Description
public
CommandContainer(SessionLocal session, String sql, Prepared prepared)

Method Summary

Modifier and TypeMethod and Description
private ResultWithGeneratedKeys
public int
public Set<DbObject>
public ArrayList<? extends ParameterInterface>
getParameters()

Implements abstract org.h2.command.Command.getParameters.

Implements org.h2.command.CommandInterface.getParameters.

Get the list of parameters.

public boolean
public boolean
isQuery()

Implements abstract org.h2.command.Command.isQuery.

Implements org.h2.command.CommandInterface.isQuery.

Check if this command is a query.

public boolean
isReadOnly()

Implements abstract org.h2.command.Command.isReadOnly.

Check if this command is read only.

protected boolean
isRetryable()

Implements abstract org.h2.command.Command.isRetryable.

Returns is this command can be repeated again on locking failure.

public boolean
isTransactional()

Implements abstract org.h2.command.Command.isTransactional.

Check if this command is transactional.

public ResultInterface
query(long
the maximum number of rows returned
maxrows
)

Implements abstract org.h2.command.Command.query.

Execute a query statement, if this is possible.

public ResultInterface
queryMeta()

Implements abstract org.h2.command.Command.queryMeta.

Get an empty result set containing the meta data.

private void
public ResultWithGeneratedKeys
update(Object
false if generated keys are not needed, true if generated keys should be configured automatically, int[] to specify column indices to return generated keys from, or String[] to specify column names to return generated keys from
generatedKeysRequest
)

Implements abstract org.h2.command.Command.update.

Execute an updating statement (for example insert, delete, or update), if this is possible.

Inherited from org.h2.command.Command:
cancelcanReusecheckCanceledcloseexecuteBatchUpdateexecuteQueryexecuteUpdategetDatabasegetMetaDatareusesetCanReusesetProgressstartstoptoString

Field Detail

preparedback to summary
private Prepared prepared
readOnlyback to summary
private boolean readOnly
readOnlyKnownback to summary
private boolean readOnlyKnown

Constructor Detail

CommandContainerback to summary
public CommandContainer(SessionLocal session, String sql, Prepared prepared)

Method Detail

executeUpdateWithGeneratedKeysback to summary
private ResultWithGeneratedKeys executeUpdateWithGeneratedKeys(DataChangeStatement statement, Object generatedKeysRequest)
getCommandTypeback to summary
public int getCommandType()

Implements org.h2.command.CommandInterface.getCommandType.

Doc from org.h2.command.CommandInterface.getCommandType.

Get command type.

Returns:int

one of the constants above

Annotations
@Override
getDependenciesback to summary
public Set<DbObject> getDependencies()

Implements abstract org.h2.command.Command.getDependencies.

Annotations
@Override
getParametersback to summary
public ArrayList<? extends ParameterInterface> getParameters()

Implements abstract org.h2.command.Command.getParameters.

Implements org.h2.command.CommandInterface.getParameters.

Doc from org.h2.command.Command.getParameters.

Get the list of parameters.

Returns:ArrayList<? extends ParameterInterface>

the list of parameters

Annotations
@Override
isCacheableback to summary
public boolean isCacheable()

Overrides org.h2.command.Command.isCacheable.

Annotations
@Override
isQueryback to summary
public boolean isQuery()

Implements abstract org.h2.command.Command.isQuery.

Implements org.h2.command.CommandInterface.isQuery.

Doc from org.h2.command.Command.isQuery.

Check if this command is a query.

Returns:boolean

true if it is

Annotations
@Override
isReadOnlyback to summary
public boolean isReadOnly()

Implements abstract org.h2.command.Command.isReadOnly.

Doc from org.h2.command.Command.isReadOnly.

Check if this command is read only.

Returns:boolean

true if it is

Annotations
@Override
isRetryableback to summary
protected boolean isRetryable()

Implements abstract org.h2.command.Command.isRetryable.

Doc from org.h2.command.Command.isRetryable.

Returns is this command can be repeated again on locking failure.

Returns:boolean

is this command can be repeated again on locking failure

Annotations
@Override
isTransactionalback to summary
public boolean isTransactional()

Implements abstract org.h2.command.Command.isTransactional.

Doc from org.h2.command.Command.isTransactional.

Check if this command is transactional. If it is not, then it forces the current transaction to commit.

Returns:boolean

true if it is

Annotations
@Override
queryback to summary
public ResultInterface query(long maxrows)

Implements abstract org.h2.command.Command.query.

Doc from org.h2.command.Command.query.

Execute a query statement, if this is possible.

Parameters
maxrows:long

the maximum number of rows returned

Returns:ResultInterface

the local result set

Annotations
@Override
queryMetaback to summary
public ResultInterface queryMeta()

Implements abstract org.h2.command.Command.queryMeta.

Doc from org.h2.command.Command.queryMeta.

Get an empty result set containing the meta data.

Returns:ResultInterface

an empty result set

Annotations
@Override
recompileIfRequiredback to summary
private void recompileIfRequired()
updateback to summary
public ResultWithGeneratedKeys update(Object generatedKeysRequest)

Implements abstract org.h2.command.Command.update.

Doc from org.h2.command.Command.update.

Execute an updating statement (for example insert, delete, or update), if this is possible.

Parameters
generatedKeysRequest:Object

false if generated keys are not needed, true if generated keys should be configured automatically, int[] to specify column indices to return generated keys from, or String[] to specify column names to return generated keys from

Returns:ResultWithGeneratedKeys

the update count and generated keys, if any

Annotations
@Override
org.h2.command back to summary

private final Class CommandContainer.GeneratedKeysCollector

extends Object
implements ResultTarget
Class Inheritance
All Implemented Interfaces
org.h2.result.ResultTarget

Collector of generated keys.

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
GeneratedKeysCollector(int[] indexes, LocalResult result)

Method Summary

Modifier and TypeMethod and Description
public void
addRow(Value...
the values
values
)

Implements org.h2.result.ResultTarget.addRow.

Add the row to the result set.

public long
getRowCount()

Implements org.h2.result.ResultTarget.getRowCount.

Get the number of rows.

public void
limitsWereApplied()

Implements org.h2.result.ResultTarget.limitsWereApplied.

A hint that sorting, offset and limit may be ignored by this result because they were applied during the query.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

indexesback to summary
private final int[] indexes
resultback to summary
private final LocalResult result

Constructor Detail

GeneratedKeysCollectorback to summary
pack-priv GeneratedKeysCollector(int[] indexes, LocalResult result)

Method Detail

addRowback to summary
public void addRow(Value... values)

Implements org.h2.result.ResultTarget.addRow.

Doc from org.h2.result.ResultTarget.addRow.

Add the row to the result set.

Parameters
values:Value[]

the values

Annotations
@Override
getRowCountback to summary
public long getRowCount()

Implements org.h2.result.ResultTarget.getRowCount.

Doc from org.h2.result.ResultTarget.getRowCount.

Get the number of rows.

Returns:long

the number of rows

Annotations
@Override
limitsWereAppliedback to summary
public void limitsWereApplied()

Implements org.h2.result.ResultTarget.limitsWereApplied.

Doc from org.h2.result.ResultTarget.limitsWereApplied.

A hint that sorting, offset and limit may be ignored by this result because they were applied during the query. This is useful for WITH TIES clause because result may contain tied rows above limit.

Annotations
@Override