org.jooq
Interface UpdatableTable<R extends Record>

Type Parameters:
R - The record type of the table
All Superinterfaces:
Adapter, AliasProvider<Table<R>>, Attachable, Comparable<NamedQueryPart>, FieldProvider, NamedQueryPart, QueryPart, SchemaProvider, Serializable, Table<R>, TableLike<R>, Type<R>, Updatable<R>
All Known Implementing Classes:
UpdatableTableImpl

public interface UpdatableTable<R extends Record>
extends Updatable<R>, Table<R>

A common interface for tables whose records can be stored back to the database again.

Author:
Lukas Eder

Method Summary
 Identity<R,? extends Number> getIdentity()
          Retrieve the table's IDENTITY information, if available.
 List<UniqueKey<R>> getKeys()
          Retrieve all of the table's unique keys.
 UniqueKey<R> getMainKey()
          Retrieve the table's main unique key.
<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.
 
Methods inherited from interface org.jooq.Updatable
getMainUniqueKey, getPrimaryKey
 
Methods inherited from interface org.jooq.Table
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, getConfiguration
 
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
 

Method Detail

getIdentity

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 must be part of the PRIMARY KEY or of a UNIQUE KEY in the table. 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.

Returns:
The table's IDENTITY information, or null, if no such information is available.

getMainKey

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.

Returns:
The main key. This is never null because UpdatableTable's always have at least one key.

getKeys

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

Returns:
All keys. This is never null or empty, because UpdatableTable's always have at least one key.

getReferencesFrom

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

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.


Copyright © 2011. All Rights Reserved.