public abstract class AbstractRoutine<T> extends java.lang.Object implements Routine<T>
This type is for JOOQ INTERNAL USE only. Do not reference directly
Modifier | Constructor and Description |
---|---|
protected |
AbstractRoutine(java.lang.String name,
Schema schema) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
DataType<T> type) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
DataType<X> type,
Binding<X,T> binding) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
DataType<X> type,
Converter<X,T> converter) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
DataType<X> type,
Converter<Y,T> converter,
Binding<X,Y> binding) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
Package pkg) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
Package pkg,
DataType<T> type) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
Package pkg,
DataType<X> type,
Binding<X,T> binding) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
Package pkg,
DataType<X> type,
Converter<X,T> converter) |
protected |
AbstractRoutine(java.lang.String name,
Schema schema,
Package pkg,
DataType<X> type,
Converter<Y,T> converter,
Binding<X,Y> binding) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Context<?> ctx)
|
protected void |
addInOutParameter(Parameter<?> parameter) |
protected void |
addInParameter(Parameter<?> parameter) |
protected void |
addOutParameter(Parameter<?> parameter) |
AggregateFunction<T> |
asAggregateFunction() |
Field<T> |
asField() |
Field<T> |
asField(java.lang.String alias) |
void |
attach(Configuration c)
Attach this object to a new
Configuration . |
void |
bind(BindContext context)
Deprecated.
- 3.4.0 - [#2694] - Use
QueryPartInternal.accept(Context) instead. |
Clause[] |
clauses(Context<?> ctx)
The
Clause s that are represented by this query part. |
Configuration |
configuration()
|
protected DSLContext |
create()
Internal convenience method
|
protected DSLContext |
create(Configuration configuration)
Internal convenience method
|
protected DSLContext |
create(Context<?> ctx)
Internal convenience method
|
protected static <T> Parameter<T> |
createParameter(java.lang.String name,
DataType<T> type)
Deprecated.
- Please, re-generate your routine code.
|
protected static <T> Parameter<T> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted)
Deprecated.
- Please, re-generate your routine code.
|
protected static <T,U> Parameter<U> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted,
Binding<T,U> binding)
Deprecated.
- Please, re-generate your routine code.
|
protected static <T> Parameter<T> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted,
boolean isUnnamed)
Subclasses may call this method to create
UDTField objects that
are linked to this table. |
protected static <T,U> Parameter<U> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted,
boolean isUnnamed,
Binding<T,U> binding)
Subclasses may call this method to create
UDTField objects that
are linked to this table. |
protected static <T,U> Parameter<U> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted,
boolean isUnnamed,
Converter<T,U> converter)
Subclasses may call this method to create
UDTField objects that
are linked to this table. |
protected static <T,X,U> Parameter<U> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted,
boolean isUnnamed,
Converter<X,U> converter,
Binding<T,X> binding)
Subclasses may call this method to create
UDTField objects that
are linked to this table. |
protected static <T,U> Parameter<U> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted,
Converter<T,U> converter)
Deprecated.
- Please, re-generate your routine code.
|
protected static <T,X,U> Parameter<U> |
createParameter(java.lang.String name,
DataType<T> type,
boolean isDefaulted,
Converter<X,U> converter,
Binding<T,X> binding)
Deprecated.
- Please, re-generate your routine code.
|
boolean |
declaresCTE()
Subclasses may override this
|
boolean |
declaresFields()
Subclasses may override this
|
boolean |
declaresTables()
Subclasses may override this
|
boolean |
declaresWindows()
Subclasses may override this
|
void |
detach()
Detach this object from its current
Configuration . |
boolean |
equals(java.lang.Object that)
Check whether this
QueryPart can be considered equal to
another QueryPart . |
int |
execute()
Execute the stored object on an underlying connection
|
int |
execute(Configuration c)
Execute the stored object using a
Configuration object |
boolean |
generatesCast()
Subclasses may override this
|
<Z> Z |
get(Parameter<Z> parameter) |
Catalog |
getCatalog()
Get the routine catalog.
|
java.util.List<Parameter<?>> |
getInParameters()
A list of IN parameters passed to the stored procedure as argument.
|
protected java.util.Map<Parameter<?>,Field<?>> |
getInValues() |
java.lang.String |
getName()
The name of this routine
|
java.util.List<Parameter<?>> |
getOutParameters()
A list of OUT parameters passed to the stored procedure as argument.
|
Package |
getPackage()
The container package of this stored procedure or function.
|
java.util.List<Parameter<?>> |
getParameters() |
Results |
getResults() |
Parameter<T> |
getReturnParameter()
The parameter representing this routine's
Routine.getReturnValue() |
T |
getReturnValue() |
Schema |
getSchema()
Get the routine schema
|
<Z> Z |
getValue(Parameter<Z> parameter) |
int |
hashCode()
Generate a hash code from this
QueryPart . |
protected boolean |
isOverloaded() |
protected boolean |
isPipelined() |
<Z> void |
set(Parameter<Z> parameter,
Z value)
Set the routine's IN value for an IN parameter.
|
protected void |
setField(Parameter<?> parameter,
Field<?> value) |
protected void |
setNumber(Parameter<? extends java.lang.Number> parameter,
Field<? extends java.lang.Number> value) |
protected <N extends java.lang.Number> |
setNumber(Parameter<N> parameter,
java.lang.Number value) |
protected void |
setOverloaded(boolean overloaded) |
protected void |
setPipelined(boolean pipelined) |
protected void |
setPLSQLBooleanParameter(Parameter<?> parameter) |
protected void |
setReturnParameter(Parameter<T> parameter) |
<Z> void |
setValue(Parameter<Z> parameter,
Z value)
Set the routine's IN value for an IN parameter.
|
void |
toSQL(RenderContext context)
Deprecated.
- 3.4.0 - [#2694] - Use
QueryPartInternal.accept(Context) instead. |
java.lang.String |
toString()
Render a SQL string representation of this
QueryPart . |
protected DataAccessException |
translate(java.lang.String sql,
java.sql.SQLException e)
Internal convenience method
|
protected AbstractRoutine(java.lang.String name, Schema schema)
protected AbstractRoutine(java.lang.String name, Schema schema, DataType<X> type, Converter<X,T> converter)
protected AbstractRoutine(java.lang.String name, Schema schema, DataType<X> type, Binding<X,T> binding)
protected AbstractRoutine(java.lang.String name, Schema schema, DataType<X> type, Converter<Y,T> converter, Binding<X,Y> binding)
protected AbstractRoutine(java.lang.String name, Schema schema, Package pkg, DataType<T> type)
protected AbstractRoutine(java.lang.String name, Schema schema, Package pkg, DataType<X> type, Converter<X,T> converter)
protected AbstractRoutine(java.lang.String name, Schema schema, Package pkg, DataType<X> type, Binding<X,T> binding)
protected final <N extends java.lang.Number> void setNumber(Parameter<N> parameter, java.lang.Number value)
protected final void setNumber(Parameter<? extends java.lang.Number> parameter, Field<? extends java.lang.Number> value)
public final <Z> void setValue(Parameter<Z> parameter, Z value)
Routine
public final <Z> void set(Parameter<Z> parameter, Z value)
Routine
public final void attach(Configuration c)
Attachable
Configuration
.attach
in interface Attachable
c
- A configuration or null
, if you wish to
detach this Attachable
from its previous
configuration.public final void detach()
Attachable
Configuration
.
This is the same as calling attach(null)
.
detach
in interface Attachable
public final Configuration configuration()
Attachable
configuration
in interface Attachable
public final int execute(Configuration c)
Routine
Configuration
objectpublic final int execute()
Routine
public final Clause[] clauses(Context<?> ctx)
QueryPartInternal
Clause
s that are represented by this query part.
QueryPart
s can specify several Clause
s for which an
event will be emitted before
(in forward
order) and after
(in reverse order) visiting
the the query part through Context.visit(QueryPart)
This method is for JOOQ INTERNAL USE only. Do not reference directly
clauses
in interface QueryPartInternal
Clause
s represented by this query part or
null
or an empty array if this query part does not
represent a clause.public void accept(Context<?> ctx)
QueryPartInternal
QueryPart
can accept
a Context
object
in order to render a SQL string or to bind its variables.accept
in interface QueryPartInternal
public final T getReturnValue()
getReturnValue
in interface Routine<T>
public final Results getResults()
getResults
in interface Routine<T>
public final <Z> Z getValue(Parameter<Z> parameter)
public final <Z> Z get(Parameter<Z> parameter)
public final java.util.List<Parameter<?>> getOutParameters()
Routine
Routine.getParameters()
.getOutParameters
in interface Routine<T>
Routine.getParameters()
public final java.util.List<Parameter<?>> getInParameters()
Routine
Routine.getParameters()
.getInParameters
in interface Routine<T>
Routine.getParameters()
public final java.util.List<Parameter<?>> getParameters()
getParameters
in interface Routine<T>
public final Catalog getCatalog()
Routine
getCatalog
in interface Routine<T>
public final Schema getSchema()
Routine
public final Package getPackage()
Routine
This is only supported in the SQLDialect.ORACLE
dialect.
getPackage
in interface Routine<T>
null
if
there is no such container.public final java.lang.String getName()
Routine
public final Parameter<T> getReturnParameter()
Routine
Routine.getReturnValue()
getReturnParameter
in interface Routine<T>
null
if this routine doesn't
have a return value.Routine.getParameters()
protected final void setOverloaded(boolean overloaded)
protected final boolean isOverloaded()
protected final void setPipelined(boolean pipelined)
protected final boolean isPipelined()
protected final void addInParameter(Parameter<?> parameter)
protected final void addInOutParameter(Parameter<?> parameter)
protected final void addOutParameter(Parameter<?> parameter)
protected final void setPLSQLBooleanParameter(Parameter<?> parameter)
public final AggregateFunction<T> asAggregateFunction()
@Deprecated protected static final <T> Parameter<T> createParameter(java.lang.String name, DataType<T> type)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the field@Deprecated protected static final <T> Parameter<T> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
@Deprecated protected static final <T,U> Parameter<U> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted, Converter<T,U> converter)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
@Deprecated protected static final <T,U> Parameter<U> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted, Binding<T,U> binding)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
@Deprecated protected static final <T,X,U> Parameter<U> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted, Converter<X,U> converter, Binding<T,X> binding)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
protected static final <T> Parameter<T> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted, boolean isUnnamed)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
isUnnamed
- Whether the parameter is unnamed (see
Parameter.isUnnamed()
.protected static final <T,U> Parameter<U> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted, boolean isUnnamed, Converter<T,U> converter)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
isUnnamed
- Whether the parameter is unnamed (see
Parameter.isUnnamed()
.protected static final <T,U> Parameter<U> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted, boolean isUnnamed, Binding<T,U> binding)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
isUnnamed
- Whether the parameter is unnamed (see
Parameter.isUnnamed()
.protected static final <T,X,U> Parameter<U> createParameter(java.lang.String name, DataType<T> type, boolean isDefaulted, boolean isUnnamed, Converter<X,U> converter, Binding<T,X> binding)
UDTField
objects that
are linked to this table.name
- The name of the field (case-sensitive!)type
- The data type of the fieldisDefaulted
- Whether the parameter is defaulted (see
Parameter.isDefaulted()
isUnnamed
- Whether the parameter is unnamed (see
Parameter.isUnnamed()
.public int hashCode()
QueryPart
QueryPart
.
In general, QueryPart
hash codes are the same as the hash
codes generated from QueryPart.toString()
. This guarantees consistent
behaviour with QueryPart.equals(Object)
Some QueryPart
implementations may choose to override this
behaviour for improved performance, as QueryPart.toString()
is an
expensive operation, if called many times.
@Deprecated public final void toSQL(RenderContext context)
QueryPartInternal.accept(Context)
instead.QueryPartInternal
QueryPart
to a SQL string contained in
context.sql()
. The context
will contain
additional information about how to render this QueryPart
,
e.g. whether this QueryPart
should be rendered as a
declaration or reference, whether this QueryPart
's contained
bind variables should be inlined or replaced by '?'
, etc.toSQL
in interface QueryPartInternal
@Deprecated public final void bind(BindContext context) throws DataAccessException
QueryPartInternal.accept(Context)
instead.QueryPartInternal
QueryPart
to a PreparedStatement
This method is for JOOQ INTERNAL USE only. Do not reference directly
bind
in interface QueryPartInternal
context
- The context holding the next bind index and other information
for variable bindingDataAccessException
- If something went wrong while binding a
variablepublic boolean declaresFields()
declaresFields
in interface QueryPartInternal
public boolean declaresTables()
declaresTables
in interface QueryPartInternal
public boolean declaresWindows()
declaresWindows
in interface QueryPartInternal
public boolean declaresCTE()
declaresCTE
in interface QueryPartInternal
public boolean generatesCast()
generatesCast
in interface QueryPartInternal
public boolean equals(java.lang.Object that)
QueryPart
QueryPart
can be considered equal to
another QueryPart
.
In general, QueryPart
equality is defined in terms of
QueryPart.toString()
equality. In other words, two query parts are
considered equal if their rendered SQL (with inlined bind variables) is
equal. This means that the two query parts do not necessarily have to be
of the same type.
Some QueryPart
implementations may choose to override this
behaviour for improved performance, as QueryPart.toString()
is an
expensive operation, if called many times.
public java.lang.String toString()
QueryPart
QueryPart
.
For improved debugging, this renders a SQL string of this
QueryPart
with inlined bind variables. If this
QueryPart
is Attachable
, then the attached
Configuration
may be used for rendering the SQL string, including
SQLDialect
and Settings
. Do note that most
QueryPart
instances are not attached to a
Configuration
, and thus there is no guarantee that the SQL string
will make sense in the context of a specific database.
If you wish to gain more control over the concrete SQL rendering of this
QueryPart
, use DSLContext.renderContext()
to obtain
a configurable render context for SQL rendering.
protected final DSLContext create()
protected final DSLContext create(Configuration configuration)
protected final DSLContext create(Context<?> ctx)
protected final DataAccessException translate(java.lang.String sql, java.sql.SQLException e)
Copyright © 2018. All Rights Reserved.