Class SQLServer_InnerJoin
- All Implemented Interfaces:
ADQLObject
,FromContent
Special implementation of InnerJoin
for MS SQL Server.
Important:
Instances of this class are created only by SQLServer_ADQLQueryFactory
.
This implementation just changes the behavior the getDBColumns()
.
In MS SQL Server, there is no keyword NATURAL and USING. That's why the DBColumn
s
returned by DBColumn
can not contain any DBCommonColumn
. Instead,
the DBColumn
of the first joined table (i.e. the left one) is returned.
Since this special behavior is also valid for OuterJoin
, a special implementation
of this class has been also created: SQLServer_OuterJoin
. Both must have exactly the
same behavior when getDBColumns()
is called. That's why the static function
getDBColumns(ADQLJoin)
has been created. It is called by SQLServer_InnerJoin
and SQLServer_OuterJoin
.
- Since:
- 1.4
- Version:
- 1.4 (03/2016)
- Author:
- Grégory Mantelet (ARI)
- See Also:
-
Field Summary
Fields inherited from class adql.query.from.ADQLJoin
condition, lstColumns, natural
-
Constructor Summary
ConstructorsConstructorDescriptionSQLServer_InnerJoin
(FromContent left, FromContent right) Builds a NATURAL INNER JOIN between the two given "tables".SQLServer_InnerJoin
(FromContent left, FromContent right, ClauseConstraints condition) Builds an INNER JOIN between the two given "tables" with the given condition.SQLServer_InnerJoin
(FromContent left, FromContent right, Collection<ADQLColumn> lstColumns) Builds an INNER JOIN between the two given "tables" with the given condition.SQLServer_InnerJoin
(InnerJoin toCopy) Builds a copy of the given INNER join. -
Method Summary
Modifier and TypeMethodDescriptionstatic final void
addAllExcept2
(SearchColumnList itemsToAdd, SearchColumnList target, Map<String, DBColumn> exception) Gets the list of all columns (~ database metadata) available in this FROM part.static SearchColumnList
getDBColumns
(ADQLJoin join) Gets the list of all columns (~ database metadata) available in this FROM part.Methods inherited from class adql.query.from.InnerJoin
getCopy, getJoinType
Methods inherited from class adql.query.from.ADQLJoin
addAllExcept, adqlIterator, findAtMostOneColumn, findExactlyOneColumn, getJoinCondition, getJoinedColumns, getLeftTable, getName, getPosition, getRightTable, getTables, getTablesByAlias, hasJoinedColumns, isCommonColumn, isNatural, setJoinCondition, setJoinedColumns, setLeftTable, setNatural, setPosition, setRightTable, toADQL
-
Constructor Details
-
SQLServer_InnerJoin
Builds a NATURAL INNER JOIN between the two given "tables".- Parameters:
left
- Left "table".right
- Right "table".- See Also:
-
SQLServer_InnerJoin
Builds an INNER JOIN between the two given "tables" with the given condition.- Parameters:
left
- Left "table".right
- Right "table".condition
- Join condition.- See Also:
-
SQLServer_InnerJoin
Builds an INNER JOIN between the two given "tables" with the given condition.- Parameters:
left
- Left "table".right
- Right "table".lstColumns
- List of columns to join.- See Also:
-
SQLServer_InnerJoin
Builds a copy of the given INNER join.- Parameters:
toCopy
- The INNER join to copy.- Throws:
Exception
- If there is an error during the copy.- See Also:
-
-
Method Details
-
getDBColumns
Description copied from interface:FromContent
Gets the list of all columns (~ database metadata) available in this FROM part.
Note: In the most cases, this list is generated on the fly !
- Specified by:
getDBColumns
in interfaceFromContent
- Overrides:
getDBColumns
in classADQLJoin
- Returns:
- All the available
DBColumn
s. - Throws:
UnresolvedJoinException
- If a join is not possible.
-
getDBColumns
Gets the list of all columns (~ database metadata) available in this FROM part. Columns implied in a NATURAL join or in a USING list, are not returned as a
DBCommonColumn
; actually, just the correspondingDBColumn
of the left table is returned.- Returns:
- All the available
DBColumn
s. - Throws:
UnresolvedJoinException
- If a join is not possible.
-
addAllExcept2
public static final void addAllExcept2(SearchColumnList itemsToAdd, SearchColumnList target, Map<String, DBColumn> exception)
-