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,
Package pkg) |
protected |
AbstractRoutine(String name,
Schema schema,
Package pkg,
DataType<T> type) |
Modifier and Type | Method and Description |
---|---|
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 context)
Bind all parameters of this
QueryPart to a PreparedStatement
This method is for JOOQ INTERNAL USE only. |
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(BindContext ctx)
Internal convenience method
|
protected DSLContext |
create(Configuration configuration)
Internal convenience method
|
protected DSLContext |
create(RenderContext 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. |
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 |
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() |
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 Number> parameter,
Field<? extends Number> value) |
protected void |
setNumber(Parameter<? extends Number> parameter,
Number value) |
protected void |
setOverloaded(boolean overloaded) |
protected void |
setReturnParameter(Parameter<T> parameter) |
protected void |
setValue(Parameter<?> parameter,
Object value) |
void |
toSQL(RenderContext context)
Render this
QueryPart to a SQL string contained in
context.sql() . |
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 final void setNumber(Parameter<? extends Number> parameter, Field<? extends Number> 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 final void bind(BindContext context)
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 bindingpublic final void toSQL(RenderContext context)
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
public final T getReturnValue()
getReturnValue
in interface Routine<T>
protected 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
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(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()
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.
public boolean declaresFields()
declaresFields
in interface QueryPartInternal
public boolean declaresTables()
declaresTables
in interface QueryPartInternal
public boolean declaresWindows()
declaresWindows
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(RenderContext ctx)
protected final DSLContext create(BindContext ctx)
protected final DataAccessException translate(String sql, SQLException e)
Copyright © 2014. All Rights Reserved.