org.jooq.impl
Class UpdatableTableImpl<R extends Record>

java.lang.Object
  extended by org.jooq.impl.TableImpl<R>
      extended by org.jooq.impl.UpdatableTableImpl<R>
All Implemented Interfaces:
Serializable, Comparable<NamedQueryPart>, Adapter, AliasProvider<Table<R>>, Attachable, AttachableInternal, FieldProvider, NamedQueryPart, QueryPart, QueryPartInternal, SchemaProvider, Table<R>, TableLike<R>, Type<R>, Updatable<R>, UpdatableTable<R>

public class UpdatableTableImpl<R extends Record>
extends TableImpl<R>
implements UpdatableTable<R>

A table implementation for a table holding a primary key

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

Author:
Lukas Eder
See Also:
Serialized Form

Constructor Summary
UpdatableTableImpl(String name)
           
UpdatableTableImpl(String name, Schema schema)
           
 
Method Summary
 Table<R> asTable()
          The underlying table representation of this object This method is useful for things like SELECT * FROM (SELECT * FROM x WHERE x.a = '1') WHERE ...
 Table<R> asTable(String alias)
          The underlying aliased table representation of this object This method is useful for things like SELECT * FROM (SELECT * FROM x WHERE x.a = '1') [alias] WHERE ...
 void attach(Configuration configuration)
          By default, nothing is done on an attachment event.
 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.
<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.
 org.jooq.impl.FieldList getFields()
           
 Identity<R,? extends Number> getIdentity()
          Retrieve the table's IDENTITY information, if available.
 int getIndex(Field<?> field)
          Get a fields index from this field provider
 List<UniqueKey<R>> getKeys()
          Retrieve all of the table's unique keys.
 UniqueKey<R> getMainKey()
          Retrieve the table's main unique key.
 String getName()
          The name of this query part
 List<ForeignKey<R,?>> getReferences()
          Get the list of FOREIGN KEY's of this table
<O extends Record>
List<ForeignKey<O,R>>
getReferencesFrom(Table<O> other)
          Get a list of FOREIGN KEY's of a specific table, referencing a this table.
<O extends Record>
List<ForeignKey<R,O>>
getReferencesTo(Table<O> other)
          Get a list of FOREIGN KEY's of this table, referencing a specific table.
 Schema getSchema()
           
 String getSQL()
          Retrieve the SQL code rendered by this query part.
 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.
 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 org.jooq.impl.TableImpl
as, bind, getAttachables0, getFieldList, getRecordType, toSQL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jooq.Table
getIdentity, getReferences, getReferencesTo
 
Methods inherited from interface org.jooq.Type
getRecordType
 
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
 
Methods inherited from interface org.jooq.FieldProvider
getField, getField, getField, getFields, getIndex
 
Methods inherited from interface org.jooq.SchemaProvider
getSchema
 
Methods inherited from interface org.jooq.AliasProvider
as
 
Methods inherited from interface org.jooq.TableLike
asTable, asTable
 

Constructor Detail

UpdatableTableImpl

public UpdatableTableImpl(String name)

UpdatableTableImpl

public UpdatableTableImpl(String name,
                          Schema schema)
Method Detail

getMainKey

public UniqueKey<R> getMainKey()
Retrieve the table's main unique key. If there exists a PRIMARY KEY in the table, the PRIMARY KEY is returned. Otherwise, the most suitable UNIQUE KEY is returned.

Subclasses should override this method

Specified by:
getMainKey in interface UpdatableTable<R extends Record>
Returns:
The main key. This is never null because UpdatableTable's always have at least one key.

getKeys

public List<UniqueKey<R>> getKeys()
Retrieve all of the table's unique keys.

Subclasses should override this method

Specified by:
getKeys in interface UpdatableTable<R extends Record>
Returns:
All keys. This is never null or empty, because UpdatableTable's always have at least one key.

getReferencesFrom

public final <O extends Record> List<ForeignKey<O,R>> getReferencesFrom(Table<O> other)
Description copied from interface: UpdatableTable
Get a list of FOREIGN KEY's of a specific table, referencing a this table.

Specified by:
getReferencesFrom in interface UpdatableTable<R extends Record>
Type Parameters:
O - The other table's record type
Parameters:
other - The other table of the foreign key relationship
Returns:
Some other table's FOREIGN KEY's towards an this table. This is never null.

asTable

public final Table<R> asTable()
Description copied from interface: TableLike
The underlying table representation of this object

This method is useful for things like SELECT * FROM (SELECT * FROM x WHERE x.a = '1') WHERE ...

Specified by:
asTable in interface TableLike<R extends Record>

asTable

public final Table<R> asTable(String alias)
Description copied from interface: TableLike
The underlying aliased table representation of this object

This method is useful for things like SELECT * FROM (SELECT * FROM x WHERE x.a = '1') [alias] WHERE ...

Specified by:
asTable in interface TableLike<R extends Record>

getIdentity

public Identity<R,? extends Number> getIdentity()
Retrieve the table's IDENTITY information, if available.

With SQL:2003, the concept of IDENTITY columns was introduced in most RDBMS. These are special kinds of columns that have auto-increment functionality when INSERT statements are performed.

An IDENTITY column is usually part of the PRIMARY KEY or of a UNIQUE KEY in the table, although in some RDBMS, this is not required. There can only be at most one IDENTITY column.

Note: Unfortunately, this is not supported in the Oracle dialect, where identities simulated by triggers cannot be formally detected.

Subclasses should override this method

Specified by:
getIdentity in interface Table<R extends Record>
Returns:
The table's IDENTITY information, or null, if no such information is available.

getReferences

public List<ForeignKey<R,?>> getReferences()
Get the list of FOREIGN KEY's of this table

Subclasses should override this method

Specified by:
getReferences in interface Table<R extends Record>
Returns:
This table's FOREIGN KEY's. This is never null.

getReferencesTo

public final <O extends Record> List<ForeignKey<R,O>> getReferencesTo(Table<O> other)
Get a list of FOREIGN KEY's of this table, referencing a specific table.

Specified by:
getReferencesTo in interface Table<R extends Record>
Type Parameters:
O - The other table's record type
Parameters:
other - The other table of the foreign key relationship
Returns:
This table's FOREIGN KEY's towards an other table. This is never null.

getFields

public final org.jooq.impl.FieldList 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.

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