public abstract class AbstractRoutine<T> extends java.lang.Object implements Routine<T>, AttachableInternal
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 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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(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 |
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() |
java.util.List<Result<Record>> |
getResults() |
protected Parameter<?> |
getReturnParameter() |
T |
getReturnValue() |
Schema |
getSchema()
Get the routine schema
|
protected <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 java.lang.Number> parameter,
Field<? extends java.lang.Number> value) |
protected void |
setNumber(Parameter<? extends java.lang.Number> parameter,
java.lang.Number value) |
protected void |
setOverloaded(boolean overloaded) |
protected void |
setReturnParameter(Parameter<T> parameter) |
protected void |
setValue(Parameter<?> parameter,
java.lang.Object value) |
void |
toSQL(RenderContext ctx)
Deprecated.
|
java.lang.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(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 void setNumber(Parameter<? extends java.lang.Number> parameter, java.lang.Number value)
protected final void setNumber(Parameter<? extends java.lang.Number> parameter, Field<? extends java.lang.Number> value)
protected final void setValue(Parameter<?> parameter, java.lang.Object value)
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 java.util.List<Result<Record>> getResults()
getResults
in interface Routine<T>
protected final <Z> Z getValue(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 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
protected final Parameter<?> getReturnParameter()
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(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 fieldprotected 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()
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()
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()
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()
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 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 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 © 2014. All Rights Reserved.