Class InsertIntoClause

java.lang.Object
com.espertech.esper.common.client.soda.InsertIntoClause
All Implemented Interfaces:
Serializable

public class InsertIntoClause extends Object implements Serializable
An insert-into clause consists of a stream name and column names and an optional stream selector.
See Also:
  • Constructor Details

    • InsertIntoClause

      public InsertIntoClause()
      Ctor.
    • InsertIntoClause

      public InsertIntoClause(String streamName)
      Ctor.
      Parameters:
      streamName - is the stream name to insert into
    • InsertIntoClause

      public InsertIntoClause(String streamName, String[] columnNames)
      Ctor.
      Parameters:
      streamName - is the stream name to insert into
      columnNames - column names
    • InsertIntoClause

      public InsertIntoClause(String streamName, List<String> columnNames, StreamSelector streamSelector)
      Ctor.
      Parameters:
      streamName - is the stream name to insert into
      columnNames - column names
      streamSelector - selector for either insert stream (the default) or remove stream or both
    • InsertIntoClause

      public InsertIntoClause(String streamName, List<String> columnNames, StreamSelector streamSelector, Expression eventPrecedence)
      Ctor.
      Parameters:
      streamName - is the stream name to insert into
      columnNames - column names
      streamSelector - selector for either insert stream (the default) or remove stream or both
      eventPrecedence - event precedence or null if none provided
  • Method Details

    • create

      public static InsertIntoClause create(String streamName)
      Creates the insert-into clause.
      Parameters:
      streamName - the name of the stream to insert into
      Returns:
      clause
    • create

      public static InsertIntoClause create(String streamName, String... columns)
      Creates the insert-into clause.
      Parameters:
      streamName - the name of the stream to insert into
      columns - is a list of column names
      Returns:
      clause
    • create

      public static InsertIntoClause create(String streamName, String[] columns, StreamSelector streamSelector)
      Creates the insert-into clause.
      Parameters:
      streamName - the name of the stream to insert into
      columns - is a list of column names
      streamSelector - selects the stream
      Returns:
      clause
    • create

      public static InsertIntoClause create(String streamName, String[] columns, StreamSelector streamSelector, Expression precedence)
      Creates the insert-into clause.
      Parameters:
      streamName - the name of the stream to insert into
      columns - is a list of column names
      streamSelector - selects the stream
      precedence - event precedence or null when not applicable
      Returns:
      clause
    • getStreamSelector

      public StreamSelector getStreamSelector()
      Returns the stream selector for the insert into.
      Returns:
      stream selector
    • setStreamSelector

      public void setStreamSelector(StreamSelector streamSelector)
      Sets the stream selector for the insert into.
      Parameters:
      streamSelector - stream selector
    • getStreamName

      public String getStreamName()
      Returns name of stream name to use for insert-into stream.
      Returns:
      stream name
    • getColumnNames

      public List<String> getColumnNames()
      Returns a list of column names specified optionally in the insert-into clause, or empty if none specified.
      Returns:
      column names or empty list if none supplied
    • setStreamName

      public void setStreamName(String streamName)
      Set stream name.
      Parameters:
      streamName - name
    • add

      public void add(String columnName)
      Add a column name to the insert-into clause.
      Parameters:
      columnName - to add
    • setColumnNames

      public void setColumnNames(List<String> columnNames)
      Set column names.
      Parameters:
      columnNames - names
    • getEventPrecedence

      public Expression getEventPrecedence()
      Returns null when no event-precedence is specified for the insert-into, or returns the expression returning the event-precedence
      Returns:
      event-precedence expression
    • setEventPrecedence

      public void setEventPrecedence(Expression eventPrecedence)
      Set to null when no event-precedence is specified for the insert-into, or set an expression returning the event-precedence
      Parameters:
      eventPrecedence - event-precedence expression
    • toEPL

      public void toEPL(StringWriter writer, EPStatementFormatter formatter, boolean isTopLevel)
      Renders the clause in textual representation.
      Parameters:
      writer - to output to
      formatter - for newline-whitespace formatting
      isTopLevel - to indicate if this insert-into-clause is inside other clauses.