Class SqlProcessorQuery

java.lang.Object
org.seasar.doma.jdbc.query.AbstractQuery
org.seasar.doma.jdbc.query.SqlProcessorQuery
All Implemented Interfaces:
Query

public class SqlProcessorQuery extends AbstractQuery
A query that processes SQL files. This class is responsible for loading SQL files and building prepared SQL statements with parameter binding.
  • Field Details

    • parameters

      protected final Map<String,Value> parameters
      The parameters to be bound to the SQL.
    • sqlFilePath

      protected String sqlFilePath
      The path to the SQL file.
    • sqlFile

      protected SqlFile sqlFile
      The SQL file.
    • sql

      protected PreparedSql sql
      The prepared SQL statement.
  • Constructor Details

    • SqlProcessorQuery

      public SqlProcessorQuery()
  • Method Details

    • setSqlFilePath

      public void setSqlFilePath(String sqlFilePath)
      Sets the path to the SQL file.
      Parameters:
      sqlFilePath - the SQL file path
    • addParameter

      public void addParameter(String name, Class<?> type, Object value)
      Adds a parameter to be bound to the SQL.
      Parameters:
      name - the parameter name
      type - the parameter type
      value - the parameter value
    • prepare

      public void prepare()
      Prepares this query for execution. This method must be called before getSql().
      Specified by:
      prepare in interface Query
      Overrides:
      prepare in class AbstractQuery
    • prepareSql

      protected void prepareSql()
      Prepares the SQL statement by loading the SQL file and building the prepared SQL.
    • getSql

      public PreparedSql getSql()
      Returns the prepared SQL statement.
      Returns:
      the prepared SQL statement
    • complete

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