Class FromClause
java.lang.Object
com.espertech.esper.common.client.soda.FromClause
- All Implemented Interfaces:
Serializable
The from-clause names the streams to select upon.
The most common projected stream is a filter-based stream which is created by FilterStream
.
Multiple streams can be joined by adding each stream individually.
Outer joins are also handled by this class. To create an outer join consisting of 2 streams,
add one OuterJoinQualifier
that defines the outer join relationship between the 2 streams. The outer joins between
N streams, add N-1 OuterJoinQualifier
qualifiers.
- See Also:
-
Constructor Summary
ConstructorDescriptionCtor.FromClause
(Stream... streamsList) Ctor.FromClause
(Stream streamOne, OuterJoinQualifier outerJoinQualifier, Stream streamTwo) Ctor for an outer join between two streams. -
Method Summary
Modifier and TypeMethodDescriptionadd
(OuterJoinQualifier outerJoinQualifier) Adds an outer join descriptor that defines how the streams are related via outer joins.Adds a stream.static FromClause
create()
Creates an empty from-clause to which one adds streams via the add methods.static FromClause
Creates a from clause that selects from a single stream.static FromClause
create
(Stream stream, OuterJoinQualifier outerJoinQualifier, Stream streamSecond) Creates a from-clause that lists 2 projected streams joined via outer join.Returns the outer join descriptors, if this is an outer join, or an empty list if none of the streams are outer joined.Returns the list of streams in the from-clause.void
setOuterJoinQualifiers
(List<OuterJoinQualifier> outerJoinQualifiers) Set outer joins.void
setStreams
(List<Stream> streams) Set the streams.void
toEPL
(StringWriter writer, EPStatementFormatter formatter) Renders the from-clause in textual representation.void
toEPLOptions
(StringWriter writer, EPStatementFormatter formatter, boolean includeFrom) Renders the from-clause in textual representation.
-
Constructor Details
-
FromClause
public FromClause()Ctor. -
FromClause
Ctor for an outer join between two streams.- Parameters:
streamOne
- first stream in outer joinouterJoinQualifier
- type of outer join and fields joined onstreamTwo
- second stream in outer join
-
FromClause
Ctor.- Parameters:
streamsList
- is zero or more streams in the from-clause.
-
-
Method Details
-
create
Creates an empty from-clause to which one adds streams via the add methods.- Returns:
- empty from clause
-
create
public static FromClause create(Stream stream, OuterJoinQualifier outerJoinQualifier, Stream streamSecond) Creates a from-clause that lists 2 projected streams joined via outer join.- Parameters:
stream
- first stream in outer joinouterJoinQualifier
- qualifies the outer joinstreamSecond
- second stream in outer join- Returns:
- from clause
-
create
Creates a from clause that selects from a single stream.Use
FilterStream
to create filter-based streams to add.- Parameters:
streams
- is one or more streams to add to the from clause.- Returns:
- from clause
-
add
Adds a stream.Use
FilterStream
to add filter-based streams.- Parameters:
stream
- to add- Returns:
- from clause
-
add
Adds an outer join descriptor that defines how the streams are related via outer joins.For joining N streams, add N-1 outer join qualifiers.
- Parameters:
outerJoinQualifier
- is the type of outer join and the fields in the outer join- Returns:
- from clause
-
getStreams
Returns the list of streams in the from-clause.- Returns:
- list of streams
-
toEPL
Renders the from-clause in textual representation.- Parameters:
writer
- to output toformatter
- for newline-whitespace formatting
-
toEPLOptions
Renders the from-clause in textual representation.- Parameters:
writer
- to output toincludeFrom
- flag whether to add the "from" literalformatter
- for newline-whitespace formatting
-
getOuterJoinQualifiers
Returns the outer join descriptors, if this is an outer join, or an empty list if none of the streams are outer joined.- Returns:
- list of outer join qualifiers
-
setStreams
Set the streams.- Parameters:
streams
- to set
-
setOuterJoinQualifiers
Set outer joins.- Parameters:
outerJoinQualifiers
- to set
-