Package com.espertech.esperio.db.core
Class MultiKeyMultiValueTable
java.lang.Object
com.espertech.esperio.db.core.MultiKeyMultiValueTable
-
Constructor Summary
ConstructorDescriptionMultiKeyMultiValueTable
(String tableName, String[] keyFieldNames, int[] keyTypes, String[] valueFieldNames, int[] valueTypes, StoreExceptionHandler storeExceptionHandler) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
deleteValue
(Connection connection, Object[] keys) Delete row, returning true if deleted or false if no row found to delete.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.void
insertValue
(Connection connection, Object[] keys, Object[] values) Insert row, indicating a unique-key contraint violation via StoreExceptionDBDuplicateRow.void
insertValueIgnoreDup
(Connection connection, Object[] keys, Object[] values) Insert row, ignoring a unique-key contraint violation via StoreExceptionDBDuplicateRow.boolean
isExistsKey
(Connection connection, Object[] keys) Determine if the key exists.readAll
(Connection connection) Read all rows in table.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.Object[]
readValue
(Connection connection, Object[] keys) Read value returning null if not found or the value (which can also be null).protected void
selectInsertUpdateValue
(Connection connection, Object[] keys, Object[] values) Select for the row, and if found update the row else insert a new row.void
updateInsertValue
(Connection connection, Object[] keys, Object[] values) Update row, and if not found insert row.boolean
updateValue
(Connection connection, Object[] keys, Object[] values) Update row, returning an indicator whether the row was found (true) or not (false).
-
Constructor Details
-
MultiKeyMultiValueTable
public MultiKeyMultiValueTable(String tableName, String[] keyFieldNames, int[] keyTypes, String[] valueFieldNames, int[] valueTypes, StoreExceptionHandler storeExceptionHandler) Ctor.- Parameters:
tableName
- table namekeyFieldNames
- names of key fieldskeyTypes
- types of key fieldsvalueFieldNames
- names of value fieldsvalueTypes
- types of value fieldsstoreExceptionHandler
- handler for store exceptions
-
-
Method Details
-
insertValue
Insert row, indicating a unique-key contraint violation via StoreExceptionDBDuplicateRow.- Parameters:
connection
- db connectionkeys
- key valuesvalues
- column values- Throws:
StoreExceptionDBRel
- when the insert failed, such as duplicate row
-
insertValueIgnoreDup
Insert row, ignoring a unique-key contraint violation via StoreExceptionDBDuplicateRow.- Parameters:
connection
- db connectionkeys
- key valuesvalues
- column values
-
updateValue
Update row, returning an indicator whether the row was found (true) or not (false).- Parameters:
connection
- db connectionkeys
- key valuesvalues
- column values- Returns:
- indicator whether row was found
- Throws:
StoreExceptionDBRel
- failed operation
-
deleteValueSubkeyed
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 connectionkeys
- key values- Throws:
StoreExceptionDBRel
- failed operation
-
deleteValue
Delete row, returning true if deleted or false if no row found to delete.- Parameters:
connection
- db connectionkeys
- key values- Returns:
- indicator whether row was found and deleted (true) or not found (false)
- Throws:
StoreExceptionDBRel
- failed operation
-
selectInsertUpdateValue
Select for the row, and if found update the row else insert a new row.- Parameters:
connection
- db connectionkeys
- key valuesvalues
- column values- Throws:
StoreExceptionDBRel
- failed operation
-
readValue
Read value returning null if not found or the value (which can also be null).- Parameters:
connection
- db connectionkeys
- to read- Returns:
- value
- Throws:
StoreExceptionDBRel
- failed operation
-
isExistsKey
Determine if the key exists.- Parameters:
connection
- db connectionkeys
- 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 connectionkeys
- key valuesvalues
- column values- Throws:
StoreExceptionDBRel
- failed operation
-
readAll
Read all rows in table.- Parameters:
connection
- to use- Returns:
- object array of columns
-
readAllSubkeyed
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 usekeys
- to use- Returns:
- list of objects
-