Top Fields Constructors Methods
org.jooq.impl

pack-priv final Class TableAlias<R extends org.jooq.Record>

extends AbstractTable<R extends Record>
implements QOM.TableAlias<R extends Record>, SimpleCheckQueryPart
Class Inheritance
All Implemented Interfaces
org.jooq.impl.SimpleCheckQueryPart, org.jooq.QueryPartInternal, org.jooq.QueryPart, java.io.Serializable, org.jooq.impl.QOM.TableAlias, org.jooq.impl.QOM.Aliasable, org.jooq.Table, org.jooq.SelectField, org.jooq.Typed, org.jooq.Named, org.jooq.SelectFieldOrAsterisk, org.jooq.GroupField, org.jooq.RecordQualifier, org.jooq.Fields, org.jooq.Qualified, org.jooq.TableLike
Static Imports
org.jooq.impl.Tools.CONFIG, .Tools.removeGenerator

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
pack-priv final Alias<Table<R>>
pack-priv transient FieldsImpl<R>

Constructor Summary

AccessConstructor and Description
pack-priv
TableAlias(Table<R> table, Name alias)

pack-priv
TableAlias(Table<R> table, Name alias, Predicate<Context<?>> wrapInParentheses)

pack-priv
TableAlias(Table<R> table, Name alias, Name[] fieldAliases)

pack-priv
TableAlias(Table<R> table, Name alias, Name[] fieldAliases, Predicate<Context<?>> wrapInParentheses)

Method Summary

Modifier and TypeMethod and Description
public final @NotNull Name
public final Table<R>
public final Table<R>
public final void
accept(Context<?> ctx)

Implements org.jooq.QueryPartInternal.accept.

This QueryPart can accept a Context object in order to render a SQL string or to bind its variables.
public final Table<R>
as(Name
The alias name
as
)

Overrides org.jooq.impl.AbstractTable.as.

Implements org.jooq.Table.as.

Create an alias for this table.
public final Table<R>
as(Name
The alias name
as
,
Name...
The field aliases. Excess aliases are ignored, missing aliases will be substituted by this table's field names.
fieldAliases
)

Overrides org.jooq.impl.AbstractTable.as.

Implements org.jooq.Table.as.

Create an alias for this table and its fields.
public final Clause[]
clauses(Context<?> ctx)

Overrides org.jooq.impl.AbstractTable.clauses.

Implements org.jooq.QueryPartInternal.clauses.

Deprecated as a consequence of Clause being deprecated.
The Clauses that are represented by this query part.
public final boolean
declaresTables()

Overrides org.jooq.impl.AbstractQueryPart.declaresTables.

Implements org.jooq.QueryPartInternal.declaresTables.

Check whether this QueryPart is able to declare tables in a FROM clause or JOIN clause.
public boolean
equals(Object
The other QueryPart
that
)

Overrides org.jooq.impl.AbstractNamed.equals.

Implements org.jooq.Table.equals, org.jooq.QueryPart.equals.

Check whether this QueryPart can be considered equal to another QueryPart.
pack-priv final FieldsImpl<R>
fields0()

Implements abstract org.jooq.impl.AbstractTable.fields0.

Subclasses should override this method to provide the set of fields contained in the concrete table implementation.
pack-priv Table<R>
getAliasedTable()

Get the aliased table wrapped by this table.

public final UniqueKey<R>
getPrimaryKey()

Overrides org.jooq.impl.AbstractTable.getPrimaryKey.

Implements org.jooq.Table.getPrimaryKey.

Retrieve the table's primary key
public Name
getQualifiedName()

Overrides org.jooq.impl.AbstractNamed.getQualifiedName.

Implements org.jooq.Named.getQualifiedName.

The qualified name of this object.
public final TableField<R, ?>
getRecordTimestamp()

Overrides org.jooq.impl.AbstractTable.getRecordTimestamp.

Implements org.jooq.Table.getRecordTimestamp.

Deprecated as a consequence of TableField being deprecated.
A "timestamp" field holding record timestamp information used for optimistic locking

jOOQ supports optimistic locking in UpdatableRecord#store() and UpdatableRecord#delete() if Settings#isExecuteWithOptimisticLocking() is enabled.

public Class<? extends R>
getRecordType()

Implements org.jooq.RecordQualifier.getRecordType.

The record type produced by this UDT or Table.
public final TableField<R, ?>
getRecordVersion()

Overrides org.jooq.impl.AbstractTable.getRecordVersion.

Implements org.jooq.Table.getRecordVersion.

Deprecated as a consequence of TableField being deprecated.
A "version" field holding record version information used for optimistic locking

jOOQ supports optimistic locking in UpdatableRecord#store() and UpdatableRecord#delete() if Settings#isExecuteWithOptimisticLocking() is enabled.

public final List<ForeignKey<R, ?>>
getReferences()

Overrides org.jooq.impl.AbstractTable.getReferences.

Implements org.jooq.Table.getReferences.

Get the list of FOREIGN KEY's of this table
public final List<UniqueKey<R>>
getUniqueKeys()

Overrides org.jooq.impl.AbstractTable.getUniqueKeys.

Implements org.jooq.Table.getUniqueKeys.

Retrieve all of the table's unique keys.
private final FieldsImpl<R>
initFieldAliases()

Register fields for this table alias

public final boolean
isSimple(Context<?> ctx)

Overrides default org.jooq.impl.SimpleCheckQueryPart.isSimple.

Whether the QueryPart really is simple.
Inherited from org.jooq.impl.AbstractTable:
$dataType$schemaasasasasasasasasasasasasasasasMultisetasMultisetasMultisetasMultisetasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasteriskconvertconvertconvertconvertFromconvertFromconvertToconvertTocreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateField0createField0createField0createField0crossApplycrossApplycrossApplycrossApplycrossApplycrossApplycrossJoincrossJoincrossJoincrossJoincrossJoincrossJoindivideByeqequalfieldsfieldsRowforceIndexforceIndexForGroupByforceIndexForJoinforceIndexForOrderByfromfullJoinfullJoinfullJoinfullJoinfullJoinfullJoinfullOuterJoinfullOuterJoinfullOuterJoinfullOuterJoinfullOuterJoinfullOuterJoingetBindinggetCataloggetChecksgetConvertergetDataTypegetDataTypegetIdentitygetIndexesgetKeysgetOptionsgetPackagegetReferencesFromgetReferencesTogetSchemagetTableTypegetTypeignoreIndexignoreIndexForGroupByignoreIndexForJoinignoreIndexForOrderByinnerJoininnerJoininnerJoininnerJoininnerJoininnerJoinjoinjoinjoinjoinjoinjoinjoinleftAntiJoinleftJoinleftJoinleftJoinleftJoinleftJoinleftJoinleftOuterJoinleftOuterJoinleftOuterJoinleftOuterJoinleftOuterJoinleftOuterJoinleftSemiJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalJoinnaturalJoinnaturalJoinnaturalJoinnaturalJoinnaturalJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnenewRecordnotEqualouterApplyouterApplyouterApplyouterApplyouterApplyouterApplyrecordTyperightJoinrightJoinrightJoinrightJoinrightJoinrightJoinrightOuterJoinrightOuterJoinrightOuterJoinrightOuterJoinrightOuterJoinrightOuterJoinrowidstraightJoinstraightJoinstraightJoinstraightJoinstraightJoinstraightJointfuseIndexuseIndexForGroupByuseIndexForJoinuseIndexForOrderBywherewherewherewherewherewherewherewherewhereExistswhereNotExistswithOrdinality

Field Detail

aliasback to summary
pack-priv final Alias<Table<R>> alias
aliasedFieldsback to summary
pack-priv transient FieldsImpl<R> aliasedFields

Constructor Detail

TableAliasback to summary
pack-priv TableAlias(Table<R> table, Name alias)
TableAliasback to summary
pack-priv TableAlias(Table<R> table, Name alias, Predicate<Context<?>> wrapInParentheses)
TableAliasback to summary
pack-priv TableAlias(Table<R> table, Name alias, Name[] fieldAliases)
TableAliasback to summary
pack-priv TableAlias(Table<R> table, Name alias, Name[] fieldAliases, Predicate<Context<?>> wrapInParentheses)

Method Detail

$aliasback to summary
public final @NotNull Name $alias()

Overrides org.jooq.impl.AbstractTable.$alias.

Implements org.jooq.impl.QOM.TableAlias.$alias, org.jooq.impl.QOM.Aliasable.$alias.

Doc from org.jooq.impl.QOM.Aliasable.$alias.

The alias if any.

Annotations
@Override
@NotNull
$aliasedback to summary
public final Table<R> $aliased()

Overrides org.jooq.impl.AbstractTable.$aliased.

Overrides default org.jooq.impl.QOM.TableAlias.$aliased.

Implements org.jooq.impl.QOM.Aliasable.$aliased.

Doc from org.jooq.impl.QOM.Aliasable.$aliased.

The aliased part (a Field or a Table).

Annotations
@Override
$tableback to summary
public final Table<R> $table()

Implements org.jooq.impl.QOM.TableAlias.$table.

Annotations
@Override
acceptback to summary
public final void accept(Context<?> ctx)

Implements org.jooq.QueryPartInternal.accept.

Doc from org.jooq.QueryPartInternal.accept.

This QueryPart can accept a Context object in order to render a SQL string or to bind its variables.

Annotations
@Override
asback to summary
public final Table<R> as(Name as)

Overrides org.jooq.impl.AbstractTable.as.

Implements org.jooq.Table.as.

Doc from org.jooq.Table.as.

Create an alias for this table.

Note that the case-sensitivity of the returned table depends on Settings#getRenderQuotedNames() and the Name. By default, table aliases are quoted, and thus case-sensitive in many SQL dialects - use DSL#unquotedName(String...) for case-insensitive aliases.

If the argument Name#getName() is qualified, then the Name#last() part will be used.

This method works both to alias the table as well as alias the table in its SelectField form via the SelectField#as(String) override. In order to alias only the projected table expression, use DSL#field(SelectField) to wrap this table into a Field

Parameters
as:Name

The alias name

Returns:Table<R>

The table alias

Annotations
@Override
asback to summary
public final Table<R> as(Name as, Name... fieldAliases)

Overrides org.jooq.impl.AbstractTable.as.

Implements org.jooq.Table.as.

Doc from org.jooq.Table.as.

Create an alias for this table and its fields.

Note that the case-sensitivity of the returned table depends on Settings#getRenderQuotedNames() and the Name. By default, table aliases are quoted, and thus case-sensitive in many SQL dialects - use DSL#unquotedName(String...) for case-insensitive aliases.

If the argument Name#getName() is qualified, then the Name#last() part will be used.

Derived column lists for table references

Note, not all databases support derived column lists for their table aliases. On the other hand, some databases do support derived column lists, but only for derived tables. jOOQ will try to turn table references into derived tables to make this syntax work. In other words, the following statements are equivalent:


-- Using derived column lists to rename columns (e.g. Postgres)
SELECT t.a, t.b
FROM my_table t(a, b)

-- Nesting table references within derived tables (e.g. SQL Server)
SELECT t.a, t.b
FROM (
  SELECT * FROM my_table
) t(a, b)

Derived column lists for derived tables

Other databases may not support derived column lists at all, but they do support common table expressions. The following statements are equivalent:


-- Using derived column lists to rename columns (e.g. Postgres)
SELECT t.a, t.b
FROM (
  SELECT 1, 2
) AS t(a, b)

-- Using UNION ALL to produce column names (e.g. MySQL)
SELECT t.a, t.b
FROM (
  SELECT null a, null b FROM DUAL WHERE 1 = 0
  UNION ALL
  SELECT 1, 2 FROM DUAL
) t
Parameters
as:Name

The alias name

fieldAliases:Name[]

The field aliases. Excess aliases are ignored, missing aliases will be substituted by this table's field names.

Returns:Table<R>

The table alias

Annotations
@Override
clausesback to summary
public final Clause[] clauses(Context<?> ctx)

Overrides org.jooq.impl.AbstractTable.clauses.

Implements org.jooq.QueryPartInternal.clauses.

Doc from org.jooq.QueryPartInternal.clauses.

Deprecated

as a consequence of Clause being deprecated. See corresponding docs for further information.

The Clauses that are represented by this query part.

QueryParts can specify several Clauses for which an event will be emitted before (in forward order) and after (in reverse order) visiting the the query part through Context#visit(QueryPart)

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

Returns:Clause[]

The Clauses represented by this query part or null or an empty array if this query part does not represent a clause.

Annotations
@Override
declaresTablesback to summary
public final boolean declaresTables()

Overrides org.jooq.impl.AbstractQueryPart.declaresTables.

Implements org.jooq.QueryPartInternal.declaresTables.

Doc from org.jooq.QueryPartInternal.declaresTables.

Check whether this QueryPart is able to declare tables in a FROM clause or JOIN clause.

This method can be used by any Context to check how a certain SQL clause should be rendered.

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

Annotations
@Override
equalsback to summary
public boolean equals(Object that)

Overrides org.jooq.impl.AbstractNamed.equals.

Implements org.jooq.Table.equals, org.jooq.QueryPart.equals.

Doc from org.jooq.Table.equals.

Check whether this QueryPart can be considered equal to another QueryPart.

In general, QueryPart equality is defined in terms of toString() equality. In other words, two query parts are considered equal if their rendered SQL (with inlined bind variables) is equal. This means that the two query parts do not necessarily have to be of the same type.

Some QueryPart implementations may choose to override this behaviour for improved performance, as toString() is an expensive operation, if called many times.

Watch out! This is Object#equals(Object), not a jOOQ DSL feature!

Parameters
that:Object

Doc from org.jooq.QueryPart.equals.

The other QueryPart

Returns:boolean

Doc from org.jooq.QueryPart.equals.

Whether the two query parts are equal

Annotations
@Override
fields0back to summary
pack-priv final FieldsImpl<R> fields0()

Implements abstract org.jooq.impl.AbstractTable.fields0.

Doc from org.jooq.impl.AbstractTable.fields0.

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.

Annotations
@Override
getAliasedTableback to summary
pack-priv Table<R> getAliasedTable()

Get the aliased table wrapped by this table.

getPrimaryKeyback to summary
public final UniqueKey<R> getPrimaryKey()

Overrides org.jooq.impl.AbstractTable.getPrimaryKey.

Implements org.jooq.Table.getPrimaryKey.

Doc from org.jooq.Table.getPrimaryKey.

Retrieve the table's primary key

Returns:UniqueKey<R>

The primary key. This is never null for an updatable table.

Annotations
@Override
getQualifiedNameback to summary
public Name getQualifiedName()

Overrides org.jooq.impl.AbstractNamed.getQualifiedName.

Implements org.jooq.Named.getQualifiedName.

Doc from org.jooq.Named.getQualifiedName.

The qualified name of this object.

Annotations
@Override
getRecordTimestampback to summary
public final TableField<R, ?> getRecordTimestamp()

Overrides org.jooq.impl.AbstractTable.getRecordTimestamp.

Implements org.jooq.Table.getRecordTimestamp.

Doc from org.jooq.Table.getRecordTimestamp.

Deprecated

as a consequence of TableField being deprecated. See corresponding docs for further information.

A "timestamp" field holding record timestamp information used for optimistic locking

jOOQ supports optimistic locking in UpdatableRecord#store() and UpdatableRecord#delete() if Settings#isExecuteWithOptimisticLocking() is enabled. Optimistic locking is performed in a single UPDATE or DELETE statement if tables provide a "version" or "timestamp" field, or in two steps using an additional SELECT … FOR UPDATE statement otherwise.

This method is overridden in generated subclasses if their corresponding tables have been configured accordingly. A table may have both a "version" and a "timestamp" field.

Returns:TableField<R, ?>

The "timestamp" field, or null, if this table has no "timestamp" field.

Annotations
@Override
getRecordTypeback to summary
public Class<? extends R> getRecordType()

Implements org.jooq.RecordQualifier.getRecordType.

Doc from org.jooq.RecordQualifier.getRecordType.

The record type produced by this UDT or Table.

Annotations
@Override
getRecordVersionback to summary
public final TableField<R, ?> getRecordVersion()

Overrides org.jooq.impl.AbstractTable.getRecordVersion.

Implements org.jooq.Table.getRecordVersion.

Doc from org.jooq.Table.getRecordVersion.

Deprecated

as a consequence of TableField being deprecated. See corresponding docs for further information.

A "version" field holding record version information used for optimistic locking

jOOQ supports optimistic locking in UpdatableRecord#store() and UpdatableRecord#delete() if Settings#isExecuteWithOptimisticLocking() is enabled. Optimistic locking is performed in a single UPDATE or DELETE statement if tables provide a "version" or "timestamp" field, or in two steps using an additional SELECT … FOR UPDATE statement otherwise.

This method is overridden in generated subclasses if their corresponding tables have been configured accordingly. A table may have both a "version" and a "timestamp" field.

Returns:TableField<R, ?>

The "version" field, or null, if this table has no "version" field.

Annotations
@Override
getReferencesback to summary
public final List<ForeignKey<R, ?>> getReferences()

Overrides org.jooq.impl.AbstractTable.getReferences.

Implements org.jooq.Table.getReferences.

Doc from org.jooq.Table.getReferences.

Get the list of FOREIGN KEY's of this table

Returns:List<ForeignKey<R, ?>>

This table's FOREIGN KEY's. This is never null.

Annotations
@Override
getUniqueKeysback to summary
public final List<UniqueKey<R>> getUniqueKeys()

Overrides org.jooq.impl.AbstractTable.getUniqueKeys.

Implements org.jooq.Table.getUniqueKeys.

Doc from org.jooq.Table.getUniqueKeys.

Retrieve all of the table's unique keys.

Returns:List<UniqueKey<R>>

All keys. This is never null.

Annotations
@Override
initFieldAliasesback to summary
private final FieldsImpl<R> initFieldAliases()

Register fields for this table alias

Annotations
@SuppressWarnings:rawtypes, unchecked
isSimpleback to summary
public final boolean isSimple(Context<?> ctx)

Overrides default org.jooq.impl.SimpleCheckQueryPart.isSimple.

Doc from org.jooq.impl.SimpleCheckQueryPart.isSimple.

Whether the QueryPart really is simple.

e.g. an OrderField can be simple if its contents are also simple.

Annotations
@Override