Top Fields Constructors Methods
org.jooq.impl

pack-priv abstract Class AbstractDelegatingQuery<R extends org.jooq.Record, Q extends org.jooq.CloseableQuery>

extends AbstractQueryPart
implements CloseableQuery, QOM.UProxy<Q extends CloseableQuery>
Class Inheritance
All Implemented Interfaces
org.jooq.impl.QOM.UProxy, org.jooq.QueryPart, java.io.Serializable, org.jooq.CloseableQuery, java.lang.AutoCloseable, org.jooq.Query, org.jooq.AttachableQueryPart, org.jooq.Attachable, org.jooq.Statement
Known Direct Subclasses
org.jooq.impl.SelectImpl, org.jooq.impl.AbstractDelegatingDMLQuery
Imports
java.util.List, .Map, java.util.concurrent.CompletionStage, .Executor, org.jooq.CloseableQuery, .Configuration, .Context, .Param, .Record, org.jooq.conf.ParamType, org.jooq.impl.QOM.UProxy

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private final Q

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final Q
public final void
accept(Context<?> context)

Implements org.jooq.QueryPartInternal.accept.

This QueryPart can accept a Context object in order to render a SQL string or to bind its variables.
public final void
attach(Configuration
A configuration or null, if you wish to detach this Attachable from its previous configuration.
configuration
)

Implements org.jooq.Attachable.attach.

Attach this object to a new Configuration.
public final Q
bind(String
The named parameter name. If this is a number, then this is the same as calling bind(int, Object)
param
,
Object
The new bind value.
value
)

Implements org.jooq.CloseableQuery.bind.

Bind a new value to a named parameter.
public final Q
bind(int
The parameter index, starting with 1
index
,
Object
The new bind value.
value
)

Implements org.jooq.CloseableQuery.bind.

Bind a new value to an indexed parameter.
public final void
cancel()

Implements org.jooq.Query.cancel.

Cancel the underlying statement.
public final void
close()

Implements org.jooq.CloseableQuery.close.

Close the underlying statement.
public final Configuration
configuration()

Overrides org.jooq.impl.AbstractQueryPart.configuration.

Implements org.jooq.Attachable.configuration.

Get the currently attached Configuration, or null if no Configuration is attached.
public final void
detach()

Implements org.jooq.Attachable.detach.

Detach this object from its current Configuration.
public final int
execute()

Implements org.jooq.Query.execute.

Execute the query, if it has been created with a proper configuration.
public final CompletionStage<Integer>
executeAsync()

Implements org.jooq.Query.executeAsync.

Execute the query in a new CompletionStage.
public final CompletionStage<Integer>
executeAsync(Executor executor)

Implements org.jooq.Query.executeAsync.

Execute the query in a new CompletionStage that is asynchronously completed by a task running in the given executor.
public final List<Object>
getBindValues()

Implements org.jooq.AttachableQueryPart.getBindValues.

Retrieve the bind values that will be bound by this Query.
pack-priv final Q
public final Param<?>
getParam(String name)

Implements org.jooq.AttachableQueryPart.getParam.

Deprecated as a consequence of Param being deprecated.
Get a named parameter from the Query, provided its name.
public final Map<String, Param<?>>
getParams()

Implements org.jooq.AttachableQueryPart.getParams.

Get a Map of named parameters.
public final String
getSQL()

Implements org.jooq.AttachableQueryPart.getSQL.

Retrieve the SQL code rendered by this Query.
public final String
getSQL(ParamType
How to render parameters. This overrides values in Settings#getStatementType()
paramType
)

Implements org.jooq.AttachableQueryPart.getSQL.

Retrieve the SQL code rendered by this Query.
public final boolean
isExecutable()

Implements org.jooq.Query.isExecutable.

Whether this query is executable in its current state.
public final Q
keepStatement(boolean
Whether to keep the underlying statement open
keepStatement
)

Implements org.jooq.CloseableQuery.keepStatement.

Keep the query's underlying statement open after execution.
public final Q
poolable(boolean poolable)

Implements org.jooq.CloseableQuery.poolable.

Specify whether any JDBC java.sql.Statement created by this query should be java.sql.Statement#setPoolable(boolean).
public final Q
queryTimeout(int timeout)

Implements org.jooq.CloseableQuery.queryTimeout.

Specify the query timeout in number of seconds for the underlying JDBC Statement.
Inherited from org.jooq.impl.AbstractQueryPart:
clausescreatecreatecreatedeclaresCTEdeclaresFieldsdeclaresTablesdeclaresWindowsequalsgeneratesCasthashCoderendersContenttoStringtranslate

Field Detail

delegateback to summary
private final Q delegate

Constructor Detail

AbstractDelegatingQueryback to summary
pack-priv AbstractDelegatingQuery(Q delegate)

Method Detail

$delegateback to summary
public final Q $delegate()

Implements org.jooq.impl.QOM.UProxy.$delegate.

Annotations
@Override
acceptback to summary
public final void accept(Context<?> context)

Implements org.jooq.QueryPartInternal.accept.

Doc from org.jooq.QueryPartInternal.accept.

This QueryPart can accept a Context object in order to render a SQL string or to bind its variables.

Annotations
@Override
attachback to summary
public final void attach(Configuration configuration)

Implements org.jooq.Attachable.attach.

Doc from org.jooq.Attachable.attach.

Attach this object to a new Configuration.

Parameters
configuration:Configuration

A configuration or null, if you wish to detach this Attachable from its previous configuration.

Annotations
@Override
bindback to summary
public final Q bind(String param, Object value)

Implements org.jooq.CloseableQuery.bind.

Doc from org.jooq.Query.bind.

Bind a new value to a named parameter.

[#1886] If the bind value with name param is inlined ( Param#isInline()) or if this query was created with StatementType#STATIC_STATEMENT and there is an underlying PreparedStatement kept open because of keepStatement(boolean), the underlying PreparedStatement will be closed automatically in order for new bind values to have an effect.

Parameters
param:String

The named parameter name. If this is a number, then this is the same as calling bind(int, Object)

value:Object

The new bind value.

Annotations
@SuppressWarnings:unchecked
@Override
bindback to summary
public final Q bind(int index, Object value)

Implements org.jooq.CloseableQuery.bind.

Doc from org.jooq.Query.bind.

Bind a new value to an indexed parameter.

[#1886] If the bind value at index is inlined ( Param#isInline()) or if this query was created with StatementType#STATIC_STATEMENT and there is an underlying PreparedStatement kept open because of keepStatement(boolean), the underlying PreparedStatement will be closed automatically in order for new bind values to have an effect.

Parameters
index:int

The parameter index, starting with 1

value:Object

The new bind value.

Annotations
@SuppressWarnings:unchecked
@Override
cancelback to summary
public final void cancel()

Implements org.jooq.Query.cancel.

Doc from org.jooq.Query.cancel.

Cancel the underlying statement.

This cancels the query's underlying Statement or PreparedStatement. If there is no underlying open and running statement, this call is simply ignored.

Annotations
@Override
closeback to summary
public final void close()

Implements org.jooq.CloseableQuery.close.

Doc from org.jooq.CloseableQuery.close.

Close the underlying statement.

This closes the query's underlying Statement or PreparedStatement if a previous call to keepStatement(boolean) indicated that jOOQ should keep statements open after query execution. If there is no underlying open statement, this call is simply ignored.

Annotations
@Override
configurationback to summary
public final Configuration configuration()

Overrides org.jooq.impl.AbstractQueryPart.configuration.

Implements org.jooq.Attachable.configuration.

Doc from org.jooq.Attachable.configuration.

Get the currently attached Configuration, or null if no Configuration is attached.

Annotations
@Override
detachback to summary
public final void detach()

Implements org.jooq.Attachable.detach.

Doc from org.jooq.Attachable.detach.

Detach this object from its current Configuration.

This is the same as calling attach(null).

Annotations
@Override
executeback to summary
public final int execute()

Implements org.jooq.Query.execute.

Doc from org.jooq.Query.execute.

Execute the query, if it has been created with a proper configuration.

Returns:int

A result value, depending on the concrete implementation of Query:

  • Delete : the number of deleted records
  • Insert : the number of inserted records
  • Merge : the result may have no meaning
  • Select : the number of resulting records
  • Truncate : the result may have no meaning
  • Update : the number of updated records
Annotations
@Override
executeAsyncback to summary
public final CompletionStage<Integer> executeAsync()

Implements org.jooq.Query.executeAsync.

Doc from org.jooq.Query.executeAsync.

Execute the query in a new CompletionStage.

The result is asynchronously completed by a task running in an Executor provided by the underlying Configuration#executorProvider().

Returns:CompletionStage<Integer>

A result value, depending on the concrete implementation of Query:

  • Delete : the number of deleted records
  • Insert : the number of inserted records
  • Merge : the result may have no meaning
  • Select : the number of resulting records
  • Truncate : the result may have no meaning
  • Update : the number of updated records
Annotations
@Override
executeAsyncback to summary
public final CompletionStage<Integer> executeAsync(Executor executor)

Implements org.jooq.Query.executeAsync.

Doc from org.jooq.Query.executeAsync.

Execute the query in a new CompletionStage that is asynchronously completed by a task running in the given executor.

Returns:CompletionStage<Integer>

A result value, depending on the concrete implementation of Query:

  • Delete : the number of deleted records
  • Insert : the number of inserted records
  • Merge : the result may have no meaning
  • Select : the number of resulting records
  • Truncate : the result may have no meaning
  • Update : the number of updated records
Annotations
@Override
getBindValuesback to summary
public final List<Object> getBindValues()

Implements org.jooq.AttachableQueryPart.getBindValues.

Doc from org.jooq.AttachableQueryPart.getBindValues.

Retrieve the bind values that will be bound by this Query.

Unlike getParams(), which returns also inlined parameters, this returns only actual bind values that will render an actual bind value as a question mark "?"

Annotations
@Override
getDelegateback to summary
pack-priv final Q getDelegate()
getParamback to summary
public final Param<?> getParam(String name)

Implements org.jooq.AttachableQueryPart.getParam.

Doc from org.jooq.AttachableQueryPart.getParam.

Deprecated

as a consequence of Param being deprecated. See corresponding docs for further information.

Get a named parameter from the Query, provided its name.

Bind values created with DSL#val(Object) will have their bind index as name.

Annotations
@Override
getParamsback to summary
public final Map<String, Param<?>> getParams()

Implements org.jooq.AttachableQueryPart.getParams.

Doc from org.jooq.AttachableQueryPart.getParams.

Get a Map of named parameters. The Map itself cannot be modified, but the Param elements allow for modifying bind values on an existing Query.

Bind values created with DSL#val(Object) will have their bind index as name.

Annotations
@Override
getSQLback to summary
public final String getSQL()

Implements org.jooq.AttachableQueryPart.getSQL.

Doc from org.jooq.AttachableQueryPart.getSQL.

Retrieve the SQL code rendered by this Query.

Use this method, when you want to use jOOQ for object oriented query creation, but execute the query with some other technology, such as

  • JDBC
  • Spring Templates
  • JPA native queries
  • etc...

Note, this is the same as calling getSQL(ParamType). The parameter will depend on your DSLContext's Settings:

StatementType boolean parameter effect
StatementType#PREPARED_STATEMENT false (default) This will render bind variables to be used with a JDBC PreparedStatement. You can extract bind values from this Query using getBindValues()
StatementType#STATIC_STATEMENT true This will inline all bind variables in a statement to be used with a JDBC Statement

[#1520] Note that the query actually being executed might not contain any bind variables, in case the number of bind variables exceeds your SQL dialect's maximum number of supported bind variables. This is not reflected by this method, which will only use the Settings to decide whether to render bind values.

Annotations
@Override
getSQLback to summary
public final String getSQL(ParamType paramType)

Implements org.jooq.AttachableQueryPart.getSQL.

Doc from org.jooq.AttachableQueryPart.getSQL.

Retrieve the SQL code rendered by this Query.

[#1520] Note that the query actually being executed might not contain any bind variables, in case the number of bind variables exceeds your SQL dialect's maximum number of supported bind variables. This is not reflected by this method, which will only use paramType argument to decide whether to render bind values.

See getSQL() for more details.

Parameters
paramType:ParamType

How to render parameters. This overrides values in Settings#getStatementType()

Returns:String

The generated SQL

Annotations
@Override
isExecutableback to summary
public final boolean isExecutable()

Implements org.jooq.Query.isExecutable.

Doc from org.jooq.Query.isExecutable.

Whether this query is executable in its current state.

DML queries may be incomplete in structure and thus not executable. Calling execute() on such queries has no effect, but beware that getSQL() may not render valid SQL!

Annotations
@Override
keepStatementback to summary
public final Q keepStatement(boolean keepStatement)

Implements org.jooq.CloseableQuery.keepStatement.

Doc from org.jooq.Query.keepStatement.

Keep the query's underlying statement open after execution.

This indicates to jOOQ that the query's underlying Statement or PreparedStatement should be kept open after execution. If it is kept open, client code is responsible for properly closing it using CloseableQuery#close(), e.g. via a try-with-resources statement.

Parameters
keepStatement:boolean

Whether to keep the underlying statement open

Annotations
@SuppressWarnings:unchecked
@Override
poolableback to summary
public final Q poolable(boolean poolable)

Implements org.jooq.CloseableQuery.poolable.

Doc from org.jooq.Query.poolable.

Specify whether any JDBC java.sql.Statement created by this query should be java.sql.Statement#setPoolable(boolean).

If this method is not called on jOOQ types, then jOOQ will not specify the flag on JDBC either, resulting in JDBC's default behaviour.

Annotations
@SuppressWarnings:unchecked
@Override
queryTimeoutback to summary
public final Q queryTimeout(int timeout)

Implements org.jooq.CloseableQuery.queryTimeout.

Doc from org.jooq.Query.queryTimeout.

Specify the query timeout in number of seconds for the underlying JDBC Statement.

Annotations
@SuppressWarnings:unchecked
@Override