org.sql.generation.api.grammar.factories
Interface TableReferenceFactory


public interface TableReferenceFactory

A factory for creating builders and syntax elements related to tables. This factory is obtainable from SQLVendor.

Author:
Stanislav Muhametsin
See Also:
SQLVendor

Method Summary
 JoinCondition jc(BooleanExpression condition)
          Creates a join-condition using specified boolean expression to join tables.
 NamedColumnsJoin nc(ColumnNameList columnNames)
          Creates a new named columns join specification, which will use column names to join tables.
 TableReferenceByExpression table(QueryExpression query)
           Creates a new table reference, which will use the values returned by query as if they were values of the table.
 TableReferenceByExpression table(QueryExpression query, TableAlias alias)
          Creates a new table reference, which will use the values returned by query as if they were values of the table.
 TableReferenceByName table(TableName tableName)
           Creates a new table reference, which uses given table name, without table alias.
 TableReferenceByName table(TableName tableName, TableAlias alias)
          Creates a new table references, which uses given table name along with given table alias.
 TableAlias tableAlias(java.lang.String tableNameAlias)
           Creates a new alias for table.
 TableAlias tableAliasWithCols(java.lang.String tableNameAlias, java.lang.String... colNames)
          Creates a new table alias for table, with renamed columns.
 TableReferenceBuilder tableBuilder(TableReferencePrimary firstTable)
          Creates a new TableReferenceBuilder typically used to build joined tables.
 TableName tableName(java.lang.String tableName)
           Creates a new table name, which isn't schema-qualified.
 TableName tableName(java.lang.String schemaName, java.lang.String tableName)
          Creates a new table name.
 

Method Detail

table

TableReferenceByName table(TableName tableName)

Creates a new table reference, which uses given table name, without table alias.

Calling this method is equivalent to calling table(TableName, TableAlias) and passing null as second parameter.

Parameters:
tableName - The table name to use.
Returns:
The new TableReferenceByName.

table

TableReferenceByName table(TableName tableName,
                           TableAlias alias)
Creates a new table references, which uses given table name along with given table alias.

Parameters:
tableName - The table name to use.
alias - The table alias to use. May be null.
Returns:
The new TableReferenceByName.

tableName

TableName tableName(java.lang.String tableName)

Creates a new table name, which isn't schema-qualified.

Calling this method is equivalent to calling tableName(String, String) and passing null as first parameter.

Parameters:
tableName - The name of the table.
Returns:
The new TableName.

tableName

TableName tableName(java.lang.String schemaName,
                    java.lang.String tableName)
Creates a new table name. If the given schema-name is non-null, the table name is said to be schema-qualified.

Parameters:
schemaName - The schema name to use. May be null.
tableName - The table name to use.
Returns:
The new TableName.

tableAlias

TableAlias tableAlias(java.lang.String tableNameAlias)

Creates a new alias for table.

Calling this method is equivalent to calling tableAliasWithCols(String, String...) and not pass anything to varargs parameter.

Parameters:
tableNameAlias - The alias for table name.
Returns:
The new TableAlias.

tableAliasWithCols

TableAlias tableAliasWithCols(java.lang.String tableNameAlias,
                              java.lang.String... colNames)
Creates a new table alias for table, with renamed columns.

Parameters:
tableNameAlias - The alias for table name.
colNames - The new column names for table.
Returns:
The new TableAlias.

table

TableReferenceByExpression table(QueryExpression query)

Creates a new table reference, which will use the values returned by query as if they were values of the table.

Calling this method is equivalent to calling table(QueryExpression, TableAlias) and passing null as second parameter.

Parameters:
query - The query to use.
Returns:
The new TableReferenceByExpression.

table

TableReferenceByExpression table(QueryExpression query,
                                 TableAlias alias)
Creates a new table reference, which will use the values returned by query as if they were values of the table. Optionally, the table will has a given alias.

Parameters:
query - The query to use.
alias - The table alias to use. May be null if no alias is needed.
Returns:
The new TableReferenceByExpression.

tableBuilder

TableReferenceBuilder tableBuilder(TableReferencePrimary firstTable)
Creates a new TableReferenceBuilder typically used to build joined tables.

Parameters:
firstTable - The starting table.
Returns:
The new TableReferenceBuilder.

jc

JoinCondition jc(BooleanExpression condition)
Creates a join-condition using specified boolean expression to join tables.

Parameters:
condition - The condition to join tables.
Returns:
The new JoinCondition.

nc

NamedColumnsJoin nc(ColumnNameList columnNames)
Creates a new named columns join specification, which will use column names to join tables.

Parameters:
columnNames - The column names to use to join tables.
Returns:
The new NamedColumnsJoin.


Copyright © 2010. All Rights Reserved.