Top Description Fields Constructors Methods
org.jooq.impl

pack-priv abstract Class AbstractAutoAliasTable<R extends org.jooq.Record>

extends AbstractTable<R extends Record>
implements AutoAlias<Table<R extends Record>>
Class Inheritance
All Implemented Interfaces
org.jooq.impl.AutoAlias, org.jooq.QueryPartInternal, org.jooq.QueryPart, java.io.Serializable
Known Direct Subclasses
org.jooq.impl.Values, org.jooq.impl.ArrayOfValues, org.jooq.impl.ArrayTable
Imports
org.jooq.Context, .Name, .Record, .Table, .TableOptions

A base implementation for AutoAlias and Table.
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
pack-priv final Name
pack-priv final Name[]

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
AbstractAutoAliasTable(Name alias, Name[] fieldAliases)

Method Summary

Modifier and TypeMethod and Description
public final Name
public final Table<R>
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.
fields
)

Overrides org.jooq.impl.AbstractTable.as.

Implements org.jooq.Table.as.

Create an alias for this table and its fields.
public final Table<R>
autoAlias(Context<?> ctx, Table<R> t)

Implements org.jooq.impl.AutoAlias.autoAlias.

Create the aliased table expression or null if no auto-alias is required.
pack-priv abstract AbstractAutoAliasTable<R>
construct(Name newAlias, Name[] newFieldAliases)

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.
Inherited from org.jooq.impl.AbstractTable:
$dataType$schemaasasasasasasasasasasasasasasasMultisetasMultisetasMultisetasMultisetasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasteriskclausesconvertconvertconvertconvertFromconvertFromconvertToconvertTocreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateFieldcreateField0createField0createField0createField0crossApplycrossApplycrossApplycrossApplycrossApplycrossApplycrossJoincrossJoincrossJoincrossJoincrossJoincrossJoindivideByeqequalfieldsfields0fieldsRowforceIndexforceIndexForGroupByforceIndexForJoinforceIndexForOrderByfromfullJoinfullJoinfullJoinfullJoinfullJoinfullJoinfullOuterJoinfullOuterJoinfullOuterJoinfullOuterJoinfullOuterJoinfullOuterJoingetBindinggetCataloggetChecksgetConvertergetDataTypegetDataTypegetIdentitygetIndexesgetKeysgetOptionsgetPackagegetPrimaryKeygetRecordTimestampgetRecordVersiongetReferencesgetReferencesFromgetReferencesTogetSchemagetTableTypegetTypegetUniqueKeysignoreIndexignoreIndexForGroupByignoreIndexForJoinignoreIndexForOrderByinnerJoininnerJoininnerJoininnerJoininnerJoininnerJoinjoinjoinjoinjoinjoinjoinjoinleftAntiJoinleftJoinleftJoinleftJoinleftJoinleftJoinleftJoinleftOuterJoinleftOuterJoinleftOuterJoinleftOuterJoinleftOuterJoinleftOuterJoinleftSemiJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalFullOuterJoinnaturalJoinnaturalJoinnaturalJoinnaturalJoinnaturalJoinnaturalJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalLeftOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnaturalRightOuterJoinnenewRecordnotEqualouterApplyouterApplyouterApplyouterApplyouterApplyouterApplyrecordTyperightJoinrightJoinrightJoinrightJoinrightJoinrightJoinrightOuterJoinrightOuterJoinrightOuterJoinrightOuterJoinrightOuterJoinrightOuterJoinrowidstraightJoinstraightJoinstraightJoinstraightJoinstraightJoinstraightJointfuseIndexuseIndexForGroupByuseIndexForJoinuseIndexForOrderBywherewherewherewherewherewherewherewherewhereExistswhereNotExistswithOrdinality

Field Detail

aliasback to summary
pack-priv final Name alias
fieldAliasesback to summary
pack-priv final Name[] fieldAliases

Constructor Detail

AbstractAutoAliasTableback to summary
pack-priv AbstractAutoAliasTable(Name alias)
AbstractAutoAliasTableback to summary
pack-priv AbstractAutoAliasTable(Name alias, Name[] fieldAliases)

Method Detail

$aliasback to summary
public final Name $alias()

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

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

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

The alias if any.

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

Overrides org.jooq.impl.AbstractTable.$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
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... fields)

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

fields: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
autoAliasback to summary
public final Table<R> autoAlias(Context<?> ctx, Table<R> t)

Implements org.jooq.impl.AutoAlias.autoAlias.

Doc from org.jooq.impl.AutoAlias.autoAlias.

Create the aliased table expression or null if no auto-alias is required.

Annotations
@Override
constructback to summary
pack-priv abstract AbstractAutoAliasTable<R> construct(Name newAlias, Name[] newFieldAliases)
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