Class SelectStatementContext
- java.lang.Object
-
- org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext
-
- org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext
-
- All Implemented Interfaces:
ParameterAware,SQLStatementContext,TableAvailable,WhereAvailable
public final class SelectStatementContext extends CommonSQLStatementContext implements TableAvailable, WhereAvailable, ParameterAware
Select SQL statement context.
-
-
Constructor Summary
Constructors Constructor Description SelectStatementContext(ShardingSphereMetaData metaData, List<Object> params, org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement sqlStatement, String defaultDatabaseName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<ColumnProjection>findColumnProjection(int columnIndex)Find column projection.Collection<org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment>getAllTables()Get all table segments.Collection<org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment>getColumnSegments()Get column segments.org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatementgetSqlStatement()Get SQL statement.Collection<org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment>getWhereSegments()Get where segments.booleanisContainsCombine()Judge whether contains combine or not.booleanisContainsDollarParameterMarker()Judge whether contains dollar parameter marker or not.booleanisContainsHaving()Judge whether contains having or not.booleanisContainsJoinQuery()Judge whether contains join query or not.booleanisContainsPartialDistinctAggregation()Judge whether contains partial distinct aggregation.booleanisContainsSubquery()Judge whether contains subquery or not.booleanisSameGroupByAndOrderByItems()Judge group by and order by sequence is same or not.voidsetIndexes(Map<String,Integer> columnLabelIndexMap)Set indexes.voidsetUpParameters(List<Object> params)Set up parameters.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.shardingsphere.infra.binder.statement.SQLStatementContext
getDatabaseType, getTablesContext
-
Methods inherited from interface org.apache.shardingsphere.infra.binder.type.TableAvailable
getTablesContext
-
-
-
-
Constructor Detail
-
SelectStatementContext
public SelectStatementContext(ShardingSphereMetaData metaData, List<Object> params, org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement sqlStatement, String defaultDatabaseName)
-
-
Method Detail
-
isContainsJoinQuery
public boolean isContainsJoinQuery()
Judge whether contains join query or not.- Returns:
- whether contains join query or not
-
isContainsSubquery
public boolean isContainsSubquery()
Judge whether contains subquery or not.- Returns:
- whether contains subquery or not
-
isContainsHaving
public boolean isContainsHaving()
Judge whether contains having or not.- Returns:
- whether contains having or not
-
isContainsCombine
public boolean isContainsCombine()
Judge whether contains combine or not.- Returns:
- whether contains combine or not
-
isContainsDollarParameterMarker
public boolean isContainsDollarParameterMarker()
Judge whether contains dollar parameter marker or not.- Returns:
- whether contains dollar parameter marker or not
-
isContainsPartialDistinctAggregation
public boolean isContainsPartialDistinctAggregation()
Judge whether contains partial distinct aggregation.- Returns:
- whether contains partial distinct aggregation
-
setIndexes
public void setIndexes(Map<String,Integer> columnLabelIndexMap)
Set indexes.- Parameters:
columnLabelIndexMap- map for column label and index
-
isSameGroupByAndOrderByItems
public boolean isSameGroupByAndOrderByItems()
Judge group by and order by sequence is same or not.- Returns:
- group by and order by sequence is same or not
-
findColumnProjection
public Optional<ColumnProjection> findColumnProjection(int columnIndex)
Find column projection.- Parameters:
columnIndex- column index- Returns:
- find column projection
-
getSqlStatement
public org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement getSqlStatement()
Description copied from interface:SQLStatementContextGet SQL statement.- Specified by:
getSqlStatementin interfaceSQLStatementContext- Returns:
- SQL statement
-
getAllTables
public Collection<org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment> getAllTables()
Description copied from interface:TableAvailableGet all table segments.- Specified by:
getAllTablesin interfaceTableAvailable- Returns:
- all table segments
-
getWhereSegments
public Collection<org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment> getWhereSegments()
Description copied from interface:WhereAvailableGet where segments.- Specified by:
getWhereSegmentsin interfaceWhereAvailable- Returns:
- where segments
-
getColumnSegments
public Collection<org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment> getColumnSegments()
Description copied from interface:WhereAvailableGet column segments.- Specified by:
getColumnSegmentsin interfaceWhereAvailable- Returns:
- column segments
-
setUpParameters
public void setUpParameters(List<Object> params)
Description copied from interface:ParameterAwareSet up parameters.- Specified by:
setUpParametersin interfaceParameterAware- Parameters:
params- parameters
-
-