Class SqlSelectQuery

All Implemented Interfaces:
Query, SelectQuery

public class SqlSelectQuery extends AbstractSelectQuery
A query that executes a SQL SELECT statement.

This class extends AbstractSelectQuery to provide functionality for executing SELECT statements. It handles SQL node transformation, expression evaluation, and SQL statement preparation.

  • Field Details

    • sqlNode

      protected SqlNode sqlNode
      The SQL node representing the query.
  • Constructor Details

    • SqlSelectQuery

      public SqlSelectQuery()
  • Method Details

    • prepare

      public void prepare()
      Prepares this query for execution. This method must be called before the query is executed.

      This implementation prepares options and SQL.

      This implementation validates that the SQL node is not null.

      Specified by:
      prepare in interface Query
      Overrides:
      prepare in class AbstractSelectQuery
    • prepareSql

      protected void prepareSql()
      Prepares the SQL statement.

      This method transforms the SQL node using the dialect, evaluates expressions, and builds the prepared SQL statement.

      Specified by:
      prepareSql in class AbstractSelectQuery
    • complete

      public void complete()
      Completes this query after execution. This method must be called after the query is executed.

      This implementation executes a count query if the select options indicate a count operation.

    • setSqlNode

      public void setSqlNode(SqlNode sqlNode)
      Sets the SQL node for this query.
      Parameters:
      sqlNode - the SQL node