org.jooq.impl
Class UDTImpl<R extends UDTRecord<R>>

java.lang.Object
  extended by org.jooq.impl.UDTImpl<R>
All Implemented Interfaces:
Serializable, Comparable<NamedQueryPart>, Adapter, Attachable, FieldProvider, NamedQueryPart, QueryPart, QueryPartInternal, SchemaProvider, Type<R>, UDT<R>

public class UDTImpl<R extends UDTRecord<R>>
extends Object
implements UDT<R>

A common base type for UDT's

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

Author:
Lukas Eder
See Also:
Serialized Form

Constructor Summary
UDTImpl(String name, Schema schema)
           
 
Method Summary
 void attach(Configuration configuration)
          Deprecated. 
 void bind(BindContext context)
          Bind all parameters of this QueryPart to a PreparedStatement This method is for JOOQ INTERNAL USE only.
 int compareTo(NamedQueryPart that)
           
protected  Factory create()
          Internal convenience method
protected  Factory create(Configuration configuration)
          Internal convenience method
protected static
<R extends UDTRecord<R>,T>
UDTField<R,T>
createField(String name, DataType<T> type, UDT<R> udt)
          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 equals(Object that)
           
 List<Object> getBindValues()
          This method is also declared as Query.getBindValues() Retrieve the bind values that will be bound by this QueryPart This method is exposed publicly in Query.getBindValues()
 DataType<R> getDataType()
          The UDT's data type as known to the database
 SQLDialect getDialect()
          Deprecated. 
<T> Field<T>
getField(Field<T> field)
          Get a specific field from this field provider.
 Field<?> getField(int index)
          Get a specific field from this field provider.
 Field<?> getField(String name)
          Get a specific field from this field provider.
protected  org.jooq.impl.FieldList getFieldList()
          Subclasses should override this method to provide the set of fields contained in the concrete table implementation.
 List<Field<?>> getFields()
           
 int getIndex(Field<?> field)
          Get a fields index from this field provider
 String getName()
          The name of this query part
 Param<?> getParam(String name)
          This method is also declared as Query.getParam(String) Retrieve a named parameter that will be bound by this QueryPart This method is exposed publicly in Query.getParam(String)
 Map<String,Param<?>> getParams()
          This method is also declared as Query.getParams() Retrieve the named parameters that will be bound by this QueryPart This method is exposed publicly in Query.getParams()
 Class<? extends R> getRecordType()
          Subclasses must override this method if they use the generic type parameter for other types than Record
 Schema getSchema()
           
 String getSQL()
          This method is also declared as Query.getSQL() Retrieve the SQL that will be rendered by this QueryPart This method is exposed publicly in Query.getSQL()
 String getSQL(boolean inline)
          This method is also declared as Query.getSQL(boolean) Retrieve the SQL that will be rendered by this QueryPart This method is exposed publicly in Query.getSQL(boolean)
 Map<String,Class<?>> getTypeMapping()
          Deprecated. 
 int hashCode()
           
<I> I
internalAPI(Class<I> internalType)
          Adapt to an internal type assuming its functionality This is for JOOQ INTERNAL USE only.
 void toSQL(RenderContext context)
          Render this QueryPart to a SQL string contained in context.sql().
 String toString()
           
protected  DataAccessException translate(String sql, SQLException e)
          Internal convenience method
protected  DataAccessException translate(String task, String sql, SQLException e)
          Deprecated. - 2.3.0 - Do not reuse
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jooq.UDT
getSchema
 
Methods inherited from interface org.jooq.NamedQueryPart
getName
 
Methods inherited from interface org.jooq.QueryPart
attach
 
Methods inherited from interface org.jooq.Adapter
internalAPI
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.jooq.FieldProvider
getField, getField, getField, getFields, getIndex
 

Constructor Detail

UDTImpl

public UDTImpl(String name,
               Schema schema)
Method Detail

getFieldList

protected final org.jooq.impl.FieldList getFieldList()
Subclasses should override this method to provide the set of fields contained in the concrete table implementation. For example, a TableAlias contains aliased fields of its AliasProvider table.


getRecordType

public Class<? extends R> getRecordType()
Subclasses must override this method if they use the generic type parameter for other types than Record

Specified by:
getRecordType in interface Type<R extends UDTRecord<R>>
Specified by:
getRecordType in interface UDT<R extends UDTRecord<R>>
Returns:
The record type produced by this table

getTypeMapping

@Deprecated
public final Map<String,Class<?>> getTypeMapping()
                                          throws SQLException
Deprecated. 

Description copied from interface: UDT
The complete type mapping for this UDT.

This method returns all types involved with this UDT, including nested types. The result can be used in ResultSet.getObject(int, Map) and similar methods.

Specified by:
getTypeMapping in interface UDT<R extends UDTRecord<R>>
Throws:
SQLException
See Also:
for the {@link Schema}'s complete type mapping

getDataType

public final DataType<R> getDataType()
Description copied from interface: UDT
The UDT's data type as known to the database

Specified by:
getDataType in interface UDT<R extends UDTRecord<R>>

toSQL

public final void toSQL(RenderContext context)
Description copied from interface: QueryPartInternal
Render this 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.

Specified by:
toSQL in interface QueryPartInternal

bind

public final void bind(BindContext context)
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:
context - The context holding the next bind index and other information for variable binding

createField

protected static final <R extends UDTRecord<R>,T> UDTField<R,T> createField(String name,
                                                                            DataType<T> type,
                                                                            UDT<R> udt)
Subclasses may call this method to create UDTField objects that are linked to this table.

Parameters:
name - The name of the field (case-sensitive!)
type - The data type of the field

getFields

public final List<Field<?>> getFields()
Specified by:
getFields in interface FieldProvider
Returns:
All available fields

getField

public final <T> Field<T> getField(Field<T> field)
Description copied from interface: FieldProvider
Get a specific field from this field provider.

Usually, this will return the field itself. However, if this is an aliased table, the field will be aliased accordingly.

Specified by:
getField in interface FieldProvider
Type Parameters:
T - The generic field type
Parameters:
field - The field to fetch
Returns:
The field itself or an aliased field

getField

public final Field<?> getField(String name)
Description copied from interface: FieldProvider
Get a specific field from this field provider.

Specified by:
getField in interface FieldProvider
Parameters:
name - The field to fetch
Returns:
The field with the given name

getField

public final Field<?> getField(int index)
Description copied from interface: FieldProvider
Get a specific field from this field provider.

Specified by:
getField in interface FieldProvider
Parameters:
index - The field's index of the field to fetch
Returns:
The field with the given name

getIndex

public final int getIndex(Field<?> field)
                   throws IllegalArgumentException
Description copied from interface: FieldProvider
Get a fields index from this field provider

Specified by:
getIndex in interface FieldProvider
Parameters:
field - The field to look for
Returns:
The field's index
Throws:
IllegalArgumentException - if the field is not contained in this provider.

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 <I> I internalAPI(Class<I> 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:
I - The internal type's generic type parameter.
Parameters:
internalType - The internal type
Returns:
This object wrapped by or cast to an internal type

attach

@Deprecated
public void attach(Configuration configuration)
Deprecated. 

Description copied from interface: QueryPart
Attach this object to a new Configuration

Specified by:
attach in interface Attachable
Specified by:
attach in interface QueryPart
Parameters:
configuration - A configuration or null, if you wish to detach this Attachable from its previous configuration.

getDialect

@Deprecated
public final SQLDialect getDialect()
Deprecated. 

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

getSQL

public final String getSQL()
This method is also declared as Query.getSQL()

Retrieve the SQL that will be rendered by this QueryPart

This method is exposed publicly in Query.getSQL()

Specified by:
getSQL in interface QueryPartInternal

getSQL

public final String getSQL(boolean inline)
This method is also declared as Query.getSQL(boolean)

Retrieve the SQL that will be rendered by this QueryPart

This method is exposed publicly in Query.getSQL(boolean)

Specified by:
getSQL in interface QueryPartInternal

getBindValues

public final List<Object> getBindValues()
This method is also declared as Query.getBindValues()

Retrieve the bind values that will be bound by this QueryPart

This method is exposed publicly in Query.getBindValues()

Specified by:
getBindValues in interface QueryPartInternal

getParams

public final Map<String,Param<?>> getParams()
This method is also declared as Query.getParams()

Retrieve the named parameters that will be bound by this QueryPart

This method is exposed publicly in Query.getParams()

Specified by:
getParams in interface QueryPartInternal

getParam

public final Param<?> getParam(String name)
This method is also declared as Query.getParam(String)

Retrieve a named parameter that will be bound by this QueryPart

This method is exposed publicly in Query.getParam(String)

Specified by:
getParam in interface QueryPartInternal

declaresFields

public boolean declaresFields()
Subclasses may override this

Specified by:
declaresFields in interface QueryPartInternal

declaresTables

public boolean declaresTables()
Subclasses may override this

Specified by:
declaresTables in interface QueryPartInternal

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

create

protected final Factory create()
Internal convenience method


create

protected final Factory create(Configuration configuration)
Internal convenience method


translate

@Deprecated
protected final DataAccessException translate(String task,
                                                         String sql,
                                                         SQLException e)
Deprecated. - 2.3.0 - Do not reuse

Internal convenience method


translate

protected final DataAccessException translate(String sql,
                                              SQLException e)
Internal convenience method



Copyright © 2012. All Rights Reserved.