Class SqlWithArguments

java.lang.Object
com.randomnoun.common.db.SqlWithArguments

public class SqlWithArguments extends Object
A container class for SQL with positional placeholders, and the arguments to be substituted into those placeholders, to be used in a JdbcTemplate.
Author:
knoxg
  • Constructor Details

    • SqlWithArguments

      public SqlWithArguments(String sql, Object[] args, int[] argTypes)
      Create a new SqlWithArguments object.
      Parameters:
      sql - the SQL, containing '?' positional placeholders
      args - the arguments to be substituted into those placeholders
      argTypes - the SQL datatypes of the arguments (as java.sql.Types constants)
  • Method Details

    • getSql

      public String getSql()
      Return the SQL, containing '?' positional placeholders
      Returns:
      the SQL, containing '?' positional placeholders
    • getArgs

      public Object[] getArgs()
      Return the arguments to be substituted into the SQL placeholders
      Returns:
      the arguments to be substituted into the SQL placeholders
    • getArgTypes

      public int[] getArgTypes()
      Return the SQL datatypes of the arguments (as java.sql.Types constants)
      Returns:
      the SQL datatypes of the arguments (as java.sql.Types constants)
    • setSql

      public void setSql(String sql)
    • setArgs

      public void setArgs(Object[] args)
    • setArgTypes

      public void setArgTypes(int[] argTypes)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object