Class SelectClause
java.lang.Object
com.espertech.esper.common.client.soda.SelectClause
- All Implemented Interfaces:
Serializable
A select-clause consists of a list of selection elements (expressions, wildcard(s), stream wildcard and the like)
and an optional stream selector.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionCtor.protected
SelectClause
(StreamSelector streamSelector, List<SelectClauseElement> selectList) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionadd
(Expression expression) Adds an expression to the select clause.add
(Expression expression, String asName) Adds an expression to the select clause and an "as"-asName for the column.Adds property names to be selected.void
addElements
(List<SelectClauseElement> selectClauseElements) Add a select expression element.addStreamWildcard
(String streamName) Adds to the select-clause a stream wildcard selector (e.g.addStreamWildcard
(String streamName, String columnName) Adds to the select-clause a stream wildcard selector with column name (e.g.Adds to the select-clause a wildcard selector (e.g.addWithAsProvidedName
(String propertyName, String asName) Adds a single property name and an "as"-asName for the column.static SelectClause
create()
Creates an empty select-clause to be added to via add methods.static SelectClause
create
(StreamSelector streamSelector) Creates an empty select-clause.static SelectClause
create
(StreamSelector streamSelector, String... propertyNames) Creates a select-clause consisting of a list of property names.static SelectClause
Creates a select-clause consisting of a list of property names.static SelectClause
createStreamWildcard
(String streamName) Creates a select-clause with a single stream wildcard selector (e.g.static SelectClause
Creates a wildcard select-clause, additional expressions can still be added.static SelectClause
createWildcard
(StreamSelector streamSelector) Creates a wildcard select-clause, additional expressions can still be added.distinct()
Sets distinct to true.distinct
(boolean distinct) Sets distinctboolean
Returns indicator whether distinct or not.Returns the list of expressions in the select clause.Returns the stream selector.boolean
Returns indicator whether distinct or not.void
setDistinct
(boolean distinct) Returns indicator whether distinct or not.void
setSelectList
(List<SelectClauseElement> selectList) Sets the list of expressions in the select clause.void
setStreamSelector
(StreamSelector streamSelector) Sets the stream selector.streamSelector
(StreamSelector streamSelector) Sets the stream selector.void
toEPL
(StringWriter writer, EPStatementFormatter formatter, boolean isTopLevel, boolean andDelete) Renders the clause in textual representation.
-
Constructor Details
-
SelectClause
public SelectClause()Ctor. -
SelectClause
Ctor.- Parameters:
streamSelector
- selects the streamselectList
- is a list of elements in the select-clause
-
-
Method Details
-
createWildcard
Creates a wildcard select-clause, additional expressions can still be added.- Returns:
- select-clause
-
create
Creates an empty select-clause to be added to via add methods.- Returns:
- select-clause
-
create
Creates a select-clause consisting of a list of property names.- Parameters:
propertyNames
- is the names of properties to select- Returns:
- select-clause
-
createStreamWildcard
Creates a select-clause with a single stream wildcard selector (e.g. select streamName.* from MyStream as streamName)- Parameters:
streamName
- is the name given to a stream- Returns:
- select-clause
-
createWildcard
Creates a wildcard select-clause, additional expressions can still be added.- Parameters:
streamSelector
- can be used to select insert or remove streams- Returns:
- select-clause
-
create
Creates an empty select-clause.- Parameters:
streamSelector
- can be used to select insert or remove streams- Returns:
- select-clause
-
create
Creates a select-clause consisting of a list of property names.- Parameters:
propertyNames
- is the names of properties to selectstreamSelector
- can be used to select insert or remove streams- Returns:
- select-clause
-
add
Adds property names to be selected.- Parameters:
propertyNames
- is a list of property names to add- Returns:
- clause
-
addWithAsProvidedName
Adds a single property name and an "as"-asName for the column.- Parameters:
propertyName
- name of propertyasName
- is the "as"-asName for the column- Returns:
- clause
-
add
Adds an expression to the select clause.- Parameters:
expression
- to add- Returns:
- clause
-
add
Adds an expression to the select clause and an "as"-asName for the column.- Parameters:
expression
- to addasName
- is the "as"-provided for the column- Returns:
- clause
-
getSelectList
Returns the list of expressions in the select clause.- Returns:
- list of expressions with column names
-
addStreamWildcard
Adds to the select-clause a stream wildcard selector (e.g. select streamName.* from MyStream as streamName)- Parameters:
streamName
- is the name given to a stream- Returns:
- select-clause
-
addWildcard
Adds to the select-clause a wildcard selector (e.g. select * from MyStream as streamName)- Returns:
- select-clause
-
addStreamWildcard
Adds to the select-clause a stream wildcard selector with column name (e.g. select streamName.* as colName from MyStream as streamName)- Parameters:
streamName
- is the name given to a streamcolumnName
- the name given to the column- Returns:
- select-clause
-
setStreamSelector
Sets the stream selector.- Parameters:
streamSelector
- stream selector to set
-
streamSelector
Sets the stream selector.- Parameters:
streamSelector
- stream selector to set- Returns:
- select clause
-
getStreamSelector
Returns the stream selector.- Returns:
- stream selector
-
setSelectList
Sets the list of expressions in the select clause.- Parameters:
selectList
- list of expressions with column names
-
addElements
Add a select expression element.- Parameters:
selectClauseElements
- to add
-
toEPL
public void toEPL(StringWriter writer, EPStatementFormatter formatter, boolean isTopLevel, boolean andDelete) Renders the clause in textual representation.- Parameters:
writer
- to output toformatter
- for newline-whitespace formattingisTopLevel
- to indicate if this select-clause is inside other clauses.andDelete
- indicator whether select and delete
-
isDistinct
public boolean isDistinct()Returns indicator whether distinct or not.- Returns:
- distinct indicator
-
getDistinct
public boolean getDistinct()Returns indicator whether distinct or not.- Returns:
- distinct indicator
-
setDistinct
public void setDistinct(boolean distinct) Returns indicator whether distinct or not.- Parameters:
distinct
- distinct indicator
-
distinct
Sets distinct- Parameters:
distinct
- distinct indicator- Returns:
- the select clause
-
distinct
Sets distinct to true.- Returns:
- the select clause
-