public abstract class AbstractRoutine<T> extends Object implements Routine<T>, AttachableInternal
This type is for JOOQ INTERNAL USE only. Do not reference directly
Modifier | Constructor and Description |
---|---|
protected |
AbstractRoutine(String name,
Schema schema) |
protected |
AbstractRoutine(String name,
Schema schema,
DataType<T> type) |
protected |
AbstractRoutine(String name,
Schema schema,
DataType<X> type,
Binding<X,T> binding) |
protected |
AbstractRoutine(String name,
Schema schema,
DataType<X> type,
Converter<X,T> converter) |
protected |
AbstractRoutine(String name,
Schema schema,
DataType<X> type,
Converter<Y,T> converter,
Binding<X,Y> binding) |
protected |
AbstractRoutine(String name,
Schema schema,
Package pkg) |
protected |
AbstractRoutine(String name,
Schema schema,
Package pkg,
DataType<T> type) |
protected |
AbstractRoutine(String name,
Schema schema,
Package pkg,
DataType<X> type,
Binding<X,T> binding) |
protected |
AbstractRoutine(String name,
Schema schema,
Package pkg,
DataType<X> type,
Converter<X,T> converter) |
protected |
AbstractRoutine(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(String alias) |
void |
attach(Configuration c)
Attach this object to a new
Configuration . |
void |
bind(BindContext ctx)
Deprecated.
|
Clause[] |
clauses(Context<?> ctx)
The
Clause s that are represented by this query part. |
Configuration |
configuration()
Get the underlying 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(String name,
DataType<T> type)
Subclasses may call this method to create
UDTField objects that
are linked to this table. |
protected static <T> Parameter<T> |
createParameter(String name,
DataType<T> type,
boolean isDefaulted)
Subclasses may call this method to create
UDTField objects that
are linked to this table. |
protected static <T,U> Parameter<U> |
createParameter(String name,
DataType<T> type,
boolean isDefaulted,
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(String name,
DataType<T> type,
boolean isDefaulted,
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(String name,
DataType<T> type,
boolean isDefaulted,
Converter<X,U> converter,
Binding<T,X> binding)
Subclasses may call this method to create
UDTField objects that
are linked to this table. |
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(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
|
List<Parameter<?>> |
getInParameters()
A list of IN parameters passed to the stored procedure as argument.
|
protected Map<Parameter<?>,Field<?>> |
getInValues() |
String |
getName()
The name of this routine
|
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.
|
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 void |
setField(Parameter<?> parameter,
Field<?> value) |
protected void |
setNumber(Parameter<? extends Number> parameter,
Field<? extends Number> value) |
protected <N extends Number> |
setNumber(Parameter<N> parameter,
Number value) |
protected void |
setOverloaded(boolean overloaded) |
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 ctx)
Deprecated.
|
String |
toString()
Render a SQL string of this
QueryPart
For improved debugging, this renders a SQL string of this
QueryPart with inlined bind variables. |
protected DataAccessException |
translate(String sql,
SQLException e)
Internal convenience method
|
protected AbstractRoutine(String name, Schema schema, DataType<X> type, Converter<X,T> converter)
protected AbstractRoutine(String name, Schema schema, DataType<X> type, Binding<X,T> binding)
protected AbstractRoutine(String name, Schema schema, DataType<X> type, Converter<Y,T> converter, Binding<X,Y> binding)
protected AbstractRoutine(String name, Schema schema, Package pkg, DataType<T> type)
protected AbstractRoutine(String name, Schema schema, Package pkg, DataType<X> type, Converter<X,T> converter)
protected AbstractRoutine(String name, Schema schema, Package pkg, DataType<X> type, Binding<X,T> binding)
protected final void setNumber(Parameter<? extends Number> parameter, Field<? extends Number> value)
public final <Z> void setValue(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()
AttachableInternal
configuration
in interface AttachableInternal
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 List<Parameter<?>> getOutParameters()
Routine
Routine.getParameters()
.getOutParameters
in interface Routine<T>
Routine.getParameters()
public final List<Parameter<?>> getInParameters()
Routine
Routine.getParameters()
.getInParameters
in interface Routine<T>
Routine.getParameters()
public final List<Parameter<?>> getParameters()
getParameters
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 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 addInParameter(Parameter<?> parameter)
protected final void addInOutParameter(Parameter<?> parameter)
protected final void addOutParameter(Parameter<?> parameter)
public final AggregateFunction<T> asAggregateFunction()
protected static final <T> Parameter<T> createParameter(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 fieldprotected static final <T> Parameter<T> createParameter(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()
protected static final <T,U> Parameter<U> createParameter(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()
protected static final <T,U> Parameter<U> createParameter(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()
protected static final <T,X,U> Parameter<U> createParameter(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()
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 void toSQL(RenderContext ctx)
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 void bind(BindContext ctx) throws DataAccessException
QueryPartInternal
QueryPart
to a PreparedStatement
This method is for JOOQ INTERNAL USE only. Do not reference directly
bind
in interface QueryPartInternal
ctx
- 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(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 String toString()
QueryPart
QueryPart
For improved debugging, this renders a SQL string of this
QueryPart
with inlined bind variables. 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(String sql, SQLException e)
Copyright © 2015. All Rights Reserved.