Class DbState

java.lang.Object
org.h2.test.synth.sql.DbState
All Implemented Interfaces:
DbInterface

public class DbState extends Object implements DbInterface
Represents a connection to a simulated database.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Commit a pending transaction.
    void
    Connect to the database.
    void
    Create an index.
    void
    createTable(org.h2.test.synth.sql.Table table)
    Create the specified table.
    org.h2.test.synth.sql.Result
    delete(org.h2.test.synth.sql.Table table, String condition)
    Delete a number of rows.
    void
    Disconnect from the database.
    void
    Drop an index.
    void
    dropTable(org.h2.test.synth.sql.Table table)
    Drop the specified table.
    void
    end()
    Close the connection and the database.
    org.h2.test.synth.sql.Result
    insert(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] c, Value[] v)
    Insert a row into a table.
    void
    Drop all objects in the database.
    void
    Roll back a pending transaction.
    org.h2.test.synth.sql.Result
    Execute a query.
    void
    setAutoCommit(boolean b)
    Enable or disable autocommit.
     
    org.h2.test.synth.sql.Result
    update(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] columns, Value[] values, String condition)
    Update the given table with the new values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • reset

      public void reset()
      Description copied from interface: DbInterface
      Drop all objects in the database.
      Specified by:
      reset in interface DbInterface
    • connect

      public void connect()
      Description copied from interface: DbInterface
      Connect to the database.
      Specified by:
      connect in interface DbInterface
    • disconnect

      public void disconnect()
      Description copied from interface: DbInterface
      Disconnect from the database.
      Specified by:
      disconnect in interface DbInterface
    • createTable

      public void createTable(org.h2.test.synth.sql.Table table)
      Description copied from interface: DbInterface
      Create the specified table.
      Specified by:
      createTable in interface DbInterface
      Parameters:
      table - the table to create
    • dropTable

      public void dropTable(org.h2.test.synth.sql.Table table)
      Description copied from interface: DbInterface
      Drop the specified table.
      Specified by:
      dropTable in interface DbInterface
      Parameters:
      table - the table to drop
    • createIndex

      public void createIndex(Index index)
      Description copied from interface: DbInterface
      Create an index.
      Specified by:
      createIndex in interface DbInterface
      Parameters:
      index - the index to create
    • dropIndex

      public void dropIndex(Index index)
      Description copied from interface: DbInterface
      Drop an index.
      Specified by:
      dropIndex in interface DbInterface
      Parameters:
      index - the index to drop
    • insert

      public org.h2.test.synth.sql.Result insert(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] c, Value[] v)
      Description copied from interface: DbInterface
      Insert a row into a table.
      Specified by:
      insert in interface DbInterface
      Parameters:
      table - the table
      c - the column list
      v - the values
      Returns:
      the result
    • select

      public org.h2.test.synth.sql.Result select(String sql)
      Description copied from interface: DbInterface
      Execute a query.
      Specified by:
      select in interface DbInterface
      Parameters:
      sql - the SQL statement
      Returns:
      the result
    • delete

      public org.h2.test.synth.sql.Result delete(org.h2.test.synth.sql.Table table, String condition)
      Description copied from interface: DbInterface
      Delete a number of rows.
      Specified by:
      delete in interface DbInterface
      Parameters:
      table - the table
      condition - the condition
      Returns:
      the result
    • update

      public org.h2.test.synth.sql.Result update(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] columns, Value[] values, String condition)
      Description copied from interface: DbInterface
      Update the given table with the new values.
      Specified by:
      update in interface DbInterface
      Parameters:
      table - the table
      columns - the columns to update
      values - the new values
      condition - the condition
      Returns:
      the result of the update
    • setAutoCommit

      public void setAutoCommit(boolean b)
      Description copied from interface: DbInterface
      Enable or disable autocommit.
      Specified by:
      setAutoCommit in interface DbInterface
      Parameters:
      b - the new value
    • commit

      public void commit()
      Description copied from interface: DbInterface
      Commit a pending transaction.
      Specified by:
      commit in interface DbInterface
    • rollback

      public void rollback()
      Description copied from interface: DbInterface
      Roll back a pending transaction.
      Specified by:
      rollback in interface DbInterface
    • end

      public void end()
      Description copied from interface: DbInterface
      Close the connection and the database.
      Specified by:
      end in interface DbInterface
    • toString

      public String toString()
      Overrides:
      toString in class Object