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 bind(Configuration configuration, PreparedStatement stmt)
          Deprecated. 
 int bind(Configuration configuration, PreparedStatement stmt, int initialIndex)
          Deprecated. 
 int bindDeclaration(Configuration configuration, PreparedStatement stmt)
          Deprecated. 
 int bindDeclaration(Configuration configuration, PreparedStatement stmt, int initialIndex)
          Deprecated. 
 int bindReference(Configuration configuration, PreparedStatement stmt)
          Deprecated. 
 int bindReference(Configuration configuration, PreparedStatement stmt, int initialIndex)
          Deprecated. 
 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()
          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()
          Reproduce the SQL dialect this QueryPart was created with This method is for JOOQ INTERNAL USE only.
 String getName()
          The name of this query part
 List<Sequence> getSequences()
          List all sequences contained in this schema
 String getSQL()
          Retrieve the SQL code rendered by this query part.
 List<Table<?>> getTables()
          List all tables contained in this schema
 Map<String,Class<?>> getTypeMapping()
          The complete type mapping for this schema.
 List<UDT<?>> getUDTs()
          List all UDTs contained in this schema
 int hashCode()
           
protected  AttachableInternal internal(Attachable part)
          Internal convenience method
protected  QueryPartInternal internal(QueryPart part)
          Internal convenience method
<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 toSQLDeclaration(Configuration configuration)
          Deprecated. 
 String toSQLDeclaration(Configuration configuration, boolean inlineParameters)
          Deprecated. 
 String toSQLReference(Configuration configuration)
          Deprecated. 
 String toSQLReference(Configuration configuration, boolean inlineParameters)
          Deprecated. 
 String toString()
           
protected  String wrapInParentheses(String sql)
          Wrap a piece of SQL code in parentheses, if not wrapped already
 
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.QueryPart
getSQL
 
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)
                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:
context - The context holding the next bind index and other information for variable binding
Throws:
SQLException

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()
                                          throws SQLException
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
Throws:
SQLException
See Also:
for a UDT-specific type mapping

addMapping

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

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

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

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

getBindValues

public final List<Object> getBindValues()
Description copied from interface: QueryPartInternal
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

toSQLReference

@Deprecated
public final String toSQLReference(Configuration configuration)
Deprecated. 

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:
configuration - The configuration overriding dialects and schemata
Returns:
SQL representation of this QueryPart
See Also:
QueryPartInternal.toSQLReference(Configuration, boolean)

toSQLReference

@Deprecated
public final String toSQLReference(Configuration configuration,
                                              boolean inlineParameters)
Deprecated. 

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

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

toSQLDeclaration

@Deprecated
public final String toSQLDeclaration(Configuration configuration)
Deprecated. 

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:
configuration - The configuration overriding dialects and schemata
Returns:
SQL representation of this QueryPart
See Also:
QueryPartInternal.toSQLDeclaration(Configuration, boolean)

toSQLDeclaration

@Deprecated
public final String toSQLDeclaration(Configuration configuration,
                                                boolean inlineParameters)
Deprecated. 

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, boolean)

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

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

bind

@Deprecated
public final int bind(Configuration configuration,
                                 PreparedStatement stmt)
               throws SQLException
Deprecated. 

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:
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)

bind

@Deprecated
public final int bind(Configuration configuration,
                                 PreparedStatement stmt,
                                 int initialIndex)
               throws SQLException
Deprecated. 

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:
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

bindReference

@Deprecated
public final int bindReference(Configuration configuration,
                                          PreparedStatement stmt)
                        throws SQLException
Deprecated. 

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)

bindReference

@Deprecated
public final int bindReference(Configuration configuration,
                                          PreparedStatement stmt,
                                          int initialIndex)
                        throws SQLException
Deprecated. 

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:
bindReference 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

bindDeclaration

@Deprecated
public final int bindDeclaration(Configuration configuration,
                                            PreparedStatement stmt)
                          throws SQLException
Deprecated. 

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

@Deprecated
public final int bindDeclaration(Configuration configuration,
                                            PreparedStatement stmt,
                                            int initialIndex)
                          throws SQLException
Deprecated. 

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:
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

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

wrapInParentheses

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


internal

protected final AttachableInternal internal(Attachable part)
Internal convenience method


internal

protected final QueryPartInternal internal(QueryPart part)
Internal convenience method


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



Copyright © 2011. All Rights Reserved.