Class AbstractSql<P extends SqlParameter>

java.lang.Object
org.seasar.doma.jdbc.AbstractSql<P>
All Implemented Interfaces:
Sql<P>
Direct Known Subclasses:
CallableSql, PreparedSql, ScriptCommand.ScriptSql

public abstract class AbstractSql<P extends SqlParameter> extends Object implements Sql<P>
A skeletal implementation of the Sql interface.
  • Field Details

    • kind

      protected final SqlKind kind
    • rawSql

      protected final String rawSql
    • formattedSql

      protected final String formattedSql
    • sqlFilePath

      protected final String sqlFilePath
    • parameters

      protected final List<P extends SqlParameter> parameters
    • sqlLogType

      protected final SqlLogType sqlLogType
  • Constructor Details

  • Method Details

    • getKind

      public SqlKind getKind()
      Description copied from interface: Sql
      Returns the kind of the SQL.
      Specified by:
      getKind in interface Sql<P extends SqlParameter>
      Returns:
      the kind of the SQL
    • getRawSql

      public String getRawSql()
      Description copied from interface: Sql
      Returns the raw SQL string.

      The bind variables are displayed as ?.

      Specified by:
      getRawSql in interface Sql<P extends SqlParameter>
      Returns:
      the raw SQL string
    • getFormattedSql

      public String getFormattedSql()
      Description copied from interface: Sql
      Returns the formatted SQL string.

      The bind variables are replaced with the string representations of the parameters.

      Specified by:
      getFormattedSql in interface Sql<P extends SqlParameter>
      Returns:
      the formatted SQL string
    • getSqlFilePath

      public String getSqlFilePath()
      Description copied from interface: Sql
      Returns the file path that contains this SQL.
      Specified by:
      getSqlFilePath in interface Sql<P extends SqlParameter>
      Returns:
      the file path that contains this SQL、or null if this SQL is auto-generated
    • getParameters

      public List<P> getParameters()
      Description copied from interface: Sql
      Returns the parameter list.
      Specified by:
      getParameters in interface Sql<P extends SqlParameter>
      Returns:
      the parameter list
    • getSqlLogType

      public SqlLogType getSqlLogType()
      Description copied from interface: Sql
      Returns the type of the SQL log.
      Specified by:
      getSqlLogType in interface Sql<P extends SqlParameter>
      Returns:
      the type of the SQL log
    • toString

      public String toString()
      Overrides:
      toString in class Object