org.jooq.util.postgres
Class PostgresSingleUDTOutParameterProcedure

java.lang.Object
  extended by org.jooq.impl.AbstractStoredProcedure
      extended by org.jooq.util.postgres.PostgresSingleUDTOutParameterProcedure
All Implemented Interfaces:
Serializable, Comparable<NamedQueryPart>, Adapter, Attachable, AttachableInternal, NamedQueryPart, QueryPart, QueryPartInternal, SchemaProvider, StoredObject, StoredProcedure

public class PostgresSingleUDTOutParameterProcedure
extends AbstractStoredProcedure

Author:
Lukas Eder
See Also:
Serialized Form

Constructor Summary
PostgresSingleUDTOutParameterProcedure(Configuration configuration, String name, Schema schema)
           
PostgresSingleUDTOutParameterProcedure(SQLDialect dialect, String name, Schema schema)
           
 
Method Summary
 void attach(Configuration c)
          Attach this record to a new Configuration
 int bind(Configuration c, PreparedStatement stmt)
          Bind all parameters of this QueryPart to a PreparedStatement.
 int bind(Configuration c, PreparedStatement stmt, int initialIndex)
          Bind all parameters of this QueryPart to a PreparedStatement.
 int bindDeclaration(Configuration configuration, PreparedStatement stmt)
          Bind all parameters of this QueryPart to a PreparedStatement.
 int bindDeclaration(Configuration configuration, PreparedStatement stmt, int initialIndex)
          The default implementation is the same as that of QueryPartInternal.bindReference(Configuration, PreparedStatement, int).
 int bindReference(Configuration configuration, PreparedStatement stmt)
          Bind all parameters of this QueryPart to a PreparedStatement.
 int bindReference(Configuration configuration, PreparedStatement stmt, int initialIndex)
          Bind all parameters of this QueryPart to a PreparedStatement.
 int compareTo(NamedQueryPart that)
           
protected  Factory create()
          Internal convenience method
 boolean equals(Object that)
           
 int execute()
          Execute the stored object on an underlying connection
 int execute(Connection connection)
          Execute the stored object on a connection
 List<Attachable> getAttachables()
          Get the list of dependent Attachables This method is for JOOQ INTERNAL USE only.
protected  List<Attachable> getAttachables(Collection<? extends QueryPart> list)
          Internal convenience method
protected  List<Attachable> getAttachables(QueryPart... list)
          Internal convenience method
protected  List<Attachable> getAttachables(Store<?> store)
          Internal convenience method
protected  List<Attachable> getAttachables0()
           
protected  List<Attachable> getAttachables2()
           
 Configuration getConfiguration()
          Get the underlying configuration
 SQLDialect getDialect()
          Reproduce the SQL dialect this QueryPart was created with This method is for JOOQ INTERNAL USE only.
 List<Parameter<?>> getInParameters()
           
protected  Map<Parameter<?>,Field<?>> getInValues()
           
 String getName()
          The name of this query part
 Package getPackage()
          The container package of this stored procedure or function.
 Schema getSchema()
           
 String getSQL()
          Retrieve the SQL code rendered by this query part.
protected
<T> T
getValue(Parameter<T> parameter)
           
 int hashCode()
           
protected  AttachableInternal internal(Attachable part)
           
protected  QueryPartInternal internal(QueryPart part)
           
<T> T
internalAPI(Class<T> internalType)
          Adapt to an internal type assuming its functionality This is for JOOQ INTERNAL USE only.
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 setValue(Parameter<?> parameter, Object value)
           
 String toSQLDeclaration(Configuration c)
          Transform this object into SQL, such that it can be used as a declaration.
 String toSQLDeclaration(Configuration c, boolean inlineParameters)
          The default implementation is the same as that of QueryPartInternal.toSQLReference(Configuration, boolean).
protected  String toSQLQualifiedName(Configuration configuration)
           
 String toSQLReference(Configuration c)
          Transform this object into SQL, such that it can be used as a reference.
 String toSQLReference(Configuration configuration, boolean inlineParameters)
          Transform this object into SQL, such that it can be used as a reference.
 String toString()
           
protected  String wrapInParentheses(String sql)
          Wrap a piece of SQL code in parentheses, if not wrapped already
 
Methods inherited from class org.jooq.impl.AbstractStoredProcedure
addInOutParameter, addInParameter, addOutParameter, getAttachables1, getOutParameters, getParameters, getReturnParameter, setReturnParameter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jooq.StoredProcedure
getInParameters
 
Methods inherited from interface org.jooq.StoredObject
execute, getPackage
 
Methods inherited from interface org.jooq.NamedQueryPart
getName
 
Methods inherited from interface org.jooq.QueryPart
getSQL
 
Methods inherited from interface org.jooq.Attachable
attach, getConfiguration
 
Methods inherited from interface org.jooq.Adapter
internalAPI
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.jooq.SchemaProvider
getSchema
 

Constructor Detail

PostgresSingleUDTOutParameterProcedure

public PostgresSingleUDTOutParameterProcedure(SQLDialect dialect,
                                              String name,
                                              Schema schema)

PostgresSingleUDTOutParameterProcedure

public PostgresSingleUDTOutParameterProcedure(Configuration configuration,
                                              String name,
                                              Schema schema)
Method Detail

getAttachables2

protected final List<Attachable> getAttachables2()
Specified by:
getAttachables2 in class AbstractStoredProcedure

execute

public final int execute()
                  throws SQLException
Description copied from interface: StoredObject
Execute the stored object on an underlying connection

Throws:
SQLException - If anything went wrong with executing the stored object
DetachedException - If this stored object is not attached

toSQLReference

public final String toSQLReference(Configuration configuration,
                                   boolean inlineParameters)
Description copied from interface: QueryPartInternal
Transform this object into SQL, such that it can be used as a reference.

This method is for JOOQ INTERNAL USE only. Do not reference directly

Parameters:
configuration - The configuration overriding dialects and schemata
inlineParameters - if set to true, all parameters are inlined, not replaced by "?"
Returns:
SQL representation of this QueryPart

bindReference

public final int bindReference(Configuration configuration,
                               PreparedStatement stmt,
                               int initialIndex)
                        throws SQLException
Description copied from interface: QueryPartInternal
Bind all parameters of this QueryPart to a PreparedStatement.

This method is for JOOQ INTERNAL USE only. Do not reference directly

Parameters:
configuration - The configuration overriding dialects and schemata
stmt - The statement to bind values to
initialIndex - The index of the next binding variable
Returns:
The index of the next binding variable
Throws:
SQLException

getValue

protected final <T> T getValue(Parameter<T> parameter)
Specified by:
getValue in class AbstractStoredProcedure

getPackage

public final Package getPackage()
Description copied from interface: StoredObject
The container package of this stored procedure or function.

This is only supported in the SQLDialect.ORACLE dialect.

Specified by:
getPackage in interface StoredObject
Returns:
The container package of this object, or null if there is no such container.

toSQLQualifiedName

protected final String toSQLQualifiedName(Configuration configuration)

getAttachables0

protected final List<Attachable> getAttachables0()

execute

public final int execute(Connection connection)
                  throws SQLException
Description copied from interface: StoredObject
Execute the stored object on a connection

Specified by:
execute in interface StoredObject
Throws:
SQLException

getInValues

protected final Map<Parameter<?>,Field<?>> getInValues()

setNumber

protected final void setNumber(Parameter<? extends Number> parameter,
                               Number value)

setNumber

protected final void setNumber(Parameter<? extends Number> parameter,
                               Field<? extends Number> value)

setValue

protected final void setValue(Parameter<?> parameter,
                              Object value)

setField

protected final void setField(Parameter<?> parameter,
                              Field<?> value)

getInParameters

public final List<Parameter<?>> getInParameters()

setOverloaded

protected final void setOverloaded(boolean overloaded)

isOverloaded

protected final boolean isOverloaded()

getAttachables

public final List<Attachable> getAttachables()
Description copied from interface: AttachableInternal
Get the list of dependent Attachables

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
getAttachables in interface AttachableInternal

getSchema

public final Schema getSchema()
Specified by:
getSchema in interface SchemaProvider
Returns:
The contained schema

getName

public final String getName()
Description copied from interface: NamedQueryPart
The name of this query part

Specified by:
getName in interface NamedQueryPart

compareTo

public final int compareTo(NamedQueryPart that)
Specified by:
compareTo in interface Comparable<NamedQueryPart>

internalAPI

public final <T> T internalAPI(Class<T> internalType)
Description copied from interface: Adapter
Adapt to an internal type assuming its functionality

This is for JOOQ INTERNAL USE only. If you need to access the internal API, these are the known possible interfaces:

Be aware though, that the internal API may change even between minor releases.

Specified by:
internalAPI in interface Adapter
Type Parameters:
T - The internal type's generic type parameter.
Parameters:
internalType - The internal type
Returns:
This object wrapped by or cast to an internal type

internal

protected final AttachableInternal internal(Attachable part)

internal

protected final QueryPartInternal internal(QueryPart part)

getSQL

public final String getSQL()
Description copied from interface: QueryPart
Retrieve the SQL code rendered by this query part.

Specified by:
getSQL in interface QueryPart

attach

public final void attach(Configuration c)
Description copied from interface: Attachable
Attach this record to a new Configuration

Specified by:
attach in interface Attachable

getConfiguration

public final Configuration getConfiguration()
Description copied from interface: Attachable
Get the underlying configuration

Specified by:
getConfiguration in interface Attachable
Specified by:
getConfiguration in interface AttachableInternal

getAttachables

protected final List<Attachable> getAttachables(Collection<? extends QueryPart> list)
Internal convenience method


getAttachables

protected final List<Attachable> getAttachables(QueryPart... list)
Internal convenience method


getAttachables

protected final List<Attachable> getAttachables(Store<?> store)
Internal convenience method


create

protected final Factory create()
Internal convenience method


toSQLReference

public final String toSQLReference(Configuration c)
Description copied from interface: QueryPartInternal
Transform this object into SQL, such that it can be used as a reference. This always results in calling toSQLReference(configuration, false)

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
toSQLReference in interface QueryPartInternal
Parameters:
c - The configuration overriding dialects and schemata
Returns:
SQL representation of this QueryPart
See Also:
QueryPartInternal.toSQLReference(Configuration, boolean)

toSQLDeclaration

public final String toSQLDeclaration(Configuration c)
Description copied from interface: QueryPartInternal
Transform this object into SQL, such that it can be used as a declaration. Usually, this is the same as calling toSQLReference(configuration, false)

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
toSQLDeclaration in interface QueryPartInternal
Parameters:
c - The configuration overriding dialects and schemata
Returns:
SQL representation of this QueryPart
See Also:
QueryPartInternal.toSQLDeclaration(Configuration, boolean)

toSQLDeclaration

public String toSQLDeclaration(Configuration c,
                               boolean inlineParameters)
The default implementation is the same as that of QueryPartInternal.toSQLReference(Configuration, boolean). Subclasses may override this method.

Specified by:
toSQLDeclaration in interface QueryPartInternal
Parameters:
c - The configuration overriding dialects and schemata
inlineParameters - if set to true, all parameters are inlined, not replaced by "?"
Returns:
SQL representation of this QueryPart

bind

public final int bind(Configuration c,
                      PreparedStatement stmt)
               throws SQLException
Description copied from interface: QueryPartInternal
Bind all parameters of this QueryPart to a PreparedStatement. This always results in calling bind(configuration, stmt, 1)

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
bind in interface QueryPartInternal
Parameters:
c - The configuration overriding dialects and schemata
stmt - The statement to bind values to
Returns:
The index of the next binding variable
Throws:
SQLException
See Also:
QueryPartInternal.bind(Configuration, PreparedStatement, int)

bind

public final int bind(Configuration c,
                      PreparedStatement stmt,
                      int initialIndex)
               throws SQLException
Description copied from interface: QueryPartInternal
Bind all parameters of this QueryPart to a PreparedStatement.

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
bind in interface QueryPartInternal
Parameters:
c - The configuration overriding dialects and schemata
stmt - The statement to bind values to
initialIndex - The index of the next binding variable
Returns:
The index of the next binding variable
Throws:
SQLException

bindReference

public final int bindReference(Configuration configuration,
                               PreparedStatement stmt)
                        throws SQLException
Description copied from interface: QueryPartInternal
Bind all parameters of this QueryPart to a PreparedStatement. This always results in calling bind(configuration, stmt, 1)

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
bindReference in interface QueryPartInternal
Parameters:
configuration - The configuration overriding dialects and schemata
stmt - The statement to bind values to
Returns:
The index of the next binding variable
Throws:
SQLException
See Also:
QueryPartInternal.bind(Configuration, PreparedStatement, int)

bindDeclaration

public final int bindDeclaration(Configuration configuration,
                                 PreparedStatement stmt)
                          throws SQLException
Description copied from interface: QueryPartInternal
Bind all parameters of this QueryPart to a PreparedStatement. This always results in calling bind(configuration, stmt, 1)

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
bindDeclaration in interface QueryPartInternal
Parameters:
configuration - The configuration overriding dialects and schemata
stmt - The statement to bind values to
Returns:
The index of the next binding variable
Throws:
SQLException
See Also:
QueryPartInternal.bind(Configuration, PreparedStatement, int)

bindDeclaration

public int bindDeclaration(Configuration configuration,
                           PreparedStatement stmt,
                           int initialIndex)
                    throws SQLException
The default implementation is the same as that of QueryPartInternal.bindReference(Configuration, PreparedStatement, int). Subclasses may override this method.

Specified by:
bindDeclaration in interface QueryPartInternal
Parameters:
configuration - The configuration overriding dialects and schemata
stmt - The statement to bind values to
initialIndex - The index of the next binding variable
Returns:
The index of the next binding variable
Throws:
SQLException

equals

public final boolean equals(Object that)
Overrides:
equals in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

toString

public final String toString()
Overrides:
toString in class Object

getDialect

public final SQLDialect getDialect()
Description copied from interface: QueryPartInternal
Reproduce the SQL dialect this QueryPart was created with

This method is for JOOQ INTERNAL USE only. Do not reference directly

Specified by:
getDialect in interface QueryPartInternal
Returns:
The SQL dialect

wrapInParentheses

protected final String wrapInParentheses(String sql)
Wrap a piece of SQL code in parentheses, if not wrapped already



Copyright © 2011. All Rights Reserved.