org.jooq.impl
Class SchemaImpl

java.lang.Object
  extended by org.jooq.impl.SchemaImpl
All Implemented Interfaces:
Serializable, Comparable<NamedQueryPart>, Adapter, Attachable, AttachableInternal, NamedQueryPart, QueryPart, QueryPartInternal, Schema

public class SchemaImpl
extends Object
implements Schema

A common base class for database schemata

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

Author:
Lukas Eder
See Also:
Serialized Form

Constructor Summary
SchemaImpl(String name)
           
 
Method Summary
protected  void addMapping(String name, Class<?> type)
           
 void attach(Configuration configuration)
          By default, nothing is done on an attachment event.
 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
 boolean declaresFields()
          Subclasses may override this
 boolean declaresTables()
          Subclasses may override this
 boolean equals(Object that)
           
 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
 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()
 Configuration getConfiguration()
          Get the underlying configuration
 SQLDialect getDialect()
          Deprecated. 
 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()
 Sequence<?> getSequence(String name)
          Get a sequence by its name (case-sensitive) in this schema, or null if no such sequence exists
 List<Sequence<?>> getSequences()
          List all sequences contained in this schema
 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)
 Table<?> getTable(String name)
          Get a table by its name (case-sensitive) in this schema, or null if no such table exists
 List<Table<?>> getTables()
          List all tables contained in this schema
 Map<String,Class<?>> getTypeMapping()
          The complete type mapping for this schema.
 UDT<?> getUDT(String name)
          Get a UDT by its name (case-sensitive) in this schema, or null if no such UDT exists
 List<UDT<?>> getUDTs()
          List all UDTs contained in this schema
 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 task, String sql, SQLException e)
          Internal convenience method
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jooq.NamedQueryPart
getName
 
Methods inherited from interface org.jooq.Attachable
attach
 
Methods inherited from interface org.jooq.Adapter
internalAPI
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

SchemaImpl

public SchemaImpl(String name)
Method Detail

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

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

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

getTypeMapping

public final Map<String,Class<?>> getTypeMapping()
Description copied from interface: Schema
The complete type mapping for this schema.

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

Specified by:
getTypeMapping in interface Schema
See Also:
for a UDT-specific type mapping

addMapping

protected final void addMapping(String name,
                                Class<?> type)

getTable

public final Table<?> getTable(String name)
Description copied from interface: Schema
Get a table by its name (case-sensitive) in this schema, or null if no such table exists

Specified by:
getTable in interface Schema

getUDT

public final UDT<?> getUDT(String name)
Description copied from interface: Schema
Get a UDT by its name (case-sensitive) in this schema, or null if no such UDT exists

Specified by:
getUDT in interface Schema

getSequence

public final Sequence<?> getSequence(String name)
Description copied from interface: Schema
Get a sequence by its name (case-sensitive) in this schema, or null if no such sequence exists

Specified by:
getSequence in interface Schema

getTables

public List<Table<?>> getTables()
List all tables contained in this schema

Subclasses should override this method

Specified by:
getTables in interface Schema

getUDTs

public List<UDT<?>> getUDTs()
List all UDTs contained in this schema

Subclasses should override this method

Specified by:
getUDTs in interface Schema

getSequences

public List<Sequence<?>> getSequences()
List all sequences contained in this schema

Subclasses should override this method

Specified by:
getSequences in interface 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

public void attach(Configuration configuration)
By default, nothing is done on an attachment event. Subclasses may override this, however, in order to receive a connection when needed

Specified by:
attach in interface Attachable

getConfiguration

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

Specified by:
getConfiguration in interface AttachableInternal

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

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


create

protected final Factory create(Configuration configuration)
Internal convenience method


translate

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



Copyright © 2012. All Rights Reserved.