Class MultiKeyMultiValueTable

java.lang.Object
com.espertech.esperio.db.core.MultiKeyMultiValueTable

public class MultiKeyMultiValueTable extends Object
  • Constructor Details

    • MultiKeyMultiValueTable

      public MultiKeyMultiValueTable(String tableName, String[] keyFieldNames, int[] keyTypes, String[] valueFieldNames, int[] valueTypes, StoreExceptionHandler storeExceptionHandler)
      Ctor.
      Parameters:
      tableName - table name
      keyFieldNames - names of key fields
      keyTypes - types of key fields
      valueFieldNames - names of value fields
      valueTypes - types of value fields
      storeExceptionHandler - handler for store exceptions
  • Method Details

    • insertValue

      public void insertValue(Connection connection, Object[] keys, Object[] values)
      Insert row, indicating a unique-key contraint violation via StoreExceptionDBDuplicateRow.
      Parameters:
      connection - db connection
      keys - key values
      values - column values
      Throws:
      StoreExceptionDBRel - when the insert failed, such as duplicate row
    • insertValueIgnoreDup

      public void insertValueIgnoreDup(Connection connection, Object[] keys, Object[] values)
      Insert row, ignoring a unique-key contraint violation via StoreExceptionDBDuplicateRow.
      Parameters:
      connection - db connection
      keys - key values
      values - column values
    • updateValue

      public boolean updateValue(Connection connection, Object[] keys, Object[] values)
      Update row, returning an indicator whether the row was found (true) or not (false).
      Parameters:
      connection - db connection
      keys - key values
      values - column values
      Returns:
      indicator whether row was found
      Throws:
      StoreExceptionDBRel - failed operation
    • deleteValueSubkeyed

      public void deleteValueSubkeyed(Connection connection, Object[] keys)
      Delete all rows with the keys matching the subset of all keys, returning true if deleted or false if no row found to delete.
      Parameters:
      connection - db connection
      keys - key values
      Throws:
      StoreExceptionDBRel - failed operation
    • deleteValue

      public boolean deleteValue(Connection connection, Object[] keys)
      Delete row, returning true if deleted or false if no row found to delete.
      Parameters:
      connection - db connection
      keys - key values
      Returns:
      indicator whether row was found and deleted (true) or not found (false)
      Throws:
      StoreExceptionDBRel - failed operation
    • selectInsertUpdateValue

      protected void selectInsertUpdateValue(Connection connection, Object[] keys, Object[] values)
      Select for the row, and if found update the row else insert a new row.
      Parameters:
      connection - db connection
      keys - key values
      values - column values
      Throws:
      StoreExceptionDBRel - failed operation
    • readValue

      public Object[] readValue(Connection connection, Object[] keys)
      Read value returning null if not found or the value (which can also be null).
      Parameters:
      connection - db connection
      keys - to read
      Returns:
      value
      Throws:
      StoreExceptionDBRel - failed operation
    • isExistsKey

      public boolean isExistsKey(Connection connection, Object[] keys)
      Determine if the key exists.
      Parameters:
      connection - db connection
      keys - key values
      Returns:
      indicator whether row exists
      Throws:
      StoreExceptionDBRel - failed operation
    • updateInsertValue

      public void updateInsertValue(Connection connection, Object[] keys, Object[] values) throws StoreExceptionDBRel
      Update row, and if not found insert row.
      Parameters:
      connection - db connection
      keys - key values
      values - column values
      Throws:
      StoreExceptionDBRel - failed operation
    • readAll

      public List<Object[]> readAll(Connection connection)
      Read all rows in table.
      Parameters:
      connection - to use
      Returns:
      object array of columns
    • readAllSubkeyed

      public List<Object[]> readAllSubkeyed(Connection connection, Object[] keys)
      Read all rows starting with the key values supplied, key value must start at the first and can between the 1st and last key.
      Parameters:
      connection - to use
      keys - to use
      Returns:
      list of objects