Class SQLServer_InnerJoin
- java.lang.Object
-
- adql.query.from.ADQLJoin
-
- adql.query.from.InnerJoin
-
- adql.query.from.SQLServer_InnerJoin
-
- All Implemented Interfaces:
ADQLObject,FromContent
public class SQLServer_InnerJoin extends InnerJoin
Special implementation of
InnerJoinfor 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 theDBColumns returned byDBColumncan not contain anyDBCommonColumn. Instead, theDBColumnof 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 whengetDBColumns()is called. That's why the static functiongetDBColumns(ADQLJoin)has been created. It is called bySQLServer_InnerJoinandSQLServer_OuterJoin.- Since:
- 1.4
- Version:
- 1.4 (03/2016)
- Author:
- Grégory Mantelet (ARI)
- See Also:
SQLServer_ADQLQueryFactory
-
-
Field Summary
-
Fields inherited from class adql.query.from.ADQLJoin
condition, lstColumns, natural
-
-
Constructor Summary
Constructors Constructor Description SQLServer_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, java.util.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddAllExcept2(SearchColumnList itemsToAdd, SearchColumnList target, java.util.Map<java.lang.String,DBColumn> exception)SearchColumnListgetDBColumns()Gets the list of all columns (~ database metadata) available in this FROM part.static SearchColumnListgetDBColumns(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 Detail
-
SQLServer_InnerJoin
public SQLServer_InnerJoin(FromContent left, FromContent right)
Builds a NATURAL INNER JOIN between the two given "tables".- Parameters:
left- Left "table".right- Right "table".- See Also:
InnerJoin(FromContent, FromContent)
-
SQLServer_InnerJoin
public SQLServer_InnerJoin(FromContent left, FromContent right, ClauseConstraints condition)
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:
InnerJoin(FromContent, FromContent, ClauseConstraints)
-
SQLServer_InnerJoin
public SQLServer_InnerJoin(FromContent left, FromContent right, java.util.Collection<ADQLColumn> lstColumns)
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:
InnerJoin(FromContent, FromContent, Collection)
-
SQLServer_InnerJoin
public SQLServer_InnerJoin(InnerJoin toCopy) throws java.lang.Exception
Builds a copy of the given INNER join.- Parameters:
toCopy- The INNER join to copy.- Throws:
java.lang.Exception- If there is an error during the copy.- See Also:
InnerJoin(InnerJoin)
-
-
Method Detail
-
getDBColumns
public SearchColumnList getDBColumns() throws UnresolvedJoinException
Description copied from interface:FromContentGets 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:
getDBColumnsin interfaceFromContent- Overrides:
getDBColumnsin classADQLJoin- Returns:
- All the available
DBColumns. - Throws:
UnresolvedJoinException- If a join is not possible.
-
getDBColumns
public static SearchColumnList getDBColumns(ADQLJoin join) throws UnresolvedJoinException
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 correspondingDBColumnof the left table is returned.- Returns:
- All the available
DBColumns. - Throws:
UnresolvedJoinException- If a join is not possible.
-
addAllExcept2
public static final void addAllExcept2(SearchColumnList itemsToAdd, SearchColumnList target, java.util.Map<java.lang.String,DBColumn> exception)
-
-