Top Fields Constructors Methods
org.jooq.impl

pack-priv abstract Class AbstractAttachableQueryPart

extends AbstractQueryPart
implements AttachableQueryPart
Class Inheritance
All Implemented Interfaces
org.jooq.AttachableQueryPart, org.jooq.QueryPart, java.io.Serializable, org.jooq.Attachable
Known Direct Subclasses
org.jooq.impl.QueriesImpl, org.jooq.impl.AbstractQuery
Static Imports
org.jooq.conf.SettingsTools.getParamType

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private Configuration

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final void
attach(Configuration
A configuration or null, if you wish to detach this Attachable from its previous configuration.
c
)

Implements org.jooq.Attachable.attach.

Attach this object to a new Configuration.
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.
pack-priv final @NotNull Configuration
pack-priv final @NotNull Configuration
public final void
detach()

Implements org.jooq.Attachable.detach.

Detach this object from its current Configuration.
public final List<Object>
getBindValues()

Implements org.jooq.AttachableQueryPart.getBindValues.

Retrieve the bind values that will be bound by this Query.
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.
Inherited from org.jooq.impl.AbstractQueryPart:
clausescreatecreatecreatedeclaresCTEdeclaresFieldsdeclaresTablesdeclaresWindowsequalsgeneratesCasthashCoderendersContenttoStringtranslate

Field Detail

configurationback to summary
private Configuration configuration

Constructor Detail

AbstractAttachableQueryPartback to summary
pack-priv AbstractAttachableQueryPart(Configuration configuration)

Method Detail

attachback to summary
public final void attach(Configuration c)

Implements org.jooq.Attachable.attach.

Doc from org.jooq.Attachable.attach.

Attach this object to a new Configuration.

Parameters
c:Configuration

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

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
configurationOrDefaultback to summary
pack-priv final @NotNull Configuration configurationOrDefault()
Annotations
@NotNull
configurationOrThrowback to summary
pack-priv final @NotNull Configuration configurationOrThrow()
Annotations
@NotNull
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
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
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