Class PrometheusTableDataItem<T extends PrometheusDataItem>
java.lang.Object
io.github.tonywasher.joceanus.prometheus.database.PrometheusTableDataItem<T>
- Type Parameters:
T- the DataType
- Direct Known Subclasses:
PrometheusTableControlData,PrometheusTableControlKeys,PrometheusTableControlKeySet,PrometheusTableDataKeySet,PrometheusTableEncrypted
Database Table class. This controls should be extended for each DataType/Table.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrometheusTableDataItem(PrometheusDataStore pDatabase, String pTable) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClose the result set and statement.protected intCount the number of items to be loaded.(package private) voidcreateDatabase(String pDatabase) Create the database.protected voidCreate the table.protected abstract voiddeclareData(PrometheusDataSet pData) Declare DataSet.protected voiddeleteItems(TethysUIThreadStatusReport pReport, PrometheusBatchControl pBatch) Delete items from the list.protected voidDrop the table.protected PrometheusDataStoreObtain database.protected PrometheusTableDefinitionAccess the table definition.protected PrometheusDataList<T> getList()Obtain the list of items.protected PrometheusDataValuesgetRowValues(String pName) Obtain row values.protected PrometheusTableDefinitionObtain table definition.protected StringAccess the table name.protected voidinsertItems(TethysUIThreadStatusReport pReport, PrometheusDataSet pData, PrometheusBatchControl pBatch) Insert new items from the list.protected voidloadItems(TethysUIThreadStatusReport pReport, PrometheusDataSet pData) Load items from the list into the table.protected abstract PrometheusDataValuesLoad an individual item from the result set.protected voidPost-Process on a load operation.protected voidTruncate the table.protected voidsetFieldValue(T pItem, MetisDataItem.MetisDataFieldId pField) Set a field value for an item.protected voidsetList(PrometheusDataList<T> pList) Set the list of items.protected voidupdateItems(TethysUIThreadStatusReport pReport, PrometheusBatchControl pBatch) Update items from the list.
-
Constructor Details
-
PrometheusTableDataItem
Constructor.- Parameters:
pDatabase- the database controlpTable- the table name
-
-
Method Details
-
getDatabase
Obtain database.- Returns:
- the database
-
getTableDef
Obtain table definition.- Returns:
- the table definition
-
getTableName
Access the table name.- Returns:
- the table name
-
getDefinition
Access the table definition.- Returns:
- the table definition
-
closeStmt
Close the result set and statement.- Throws:
SQLException- on error
-
countLoadItems
Count the number of items to be loaded.- Returns:
- the count of items
- Throws:
SQLException- on error
-
declareData
Declare DataSet.- Parameters:
pData- the Data set
-
setList
Set the list of items.- Parameters:
pList- the list of items
-
getList
Obtain the list of items.- Returns:
- the list of items
-
loadValues
Load an individual item from the result set.- Returns:
- the values for the row
- Throws:
OceanusException- on error
-
setFieldValue
protected void setFieldValue(T pItem, MetisDataItem.MetisDataFieldId pField) throws OceanusException Set a field value for an item.- Parameters:
pItem- the item to insertpField- the field id- Throws:
OceanusException- on error
-
postProcessOnLoad
Post-Process on a load operation.- Throws:
OceanusException- on error
-
loadItems
protected void loadItems(TethysUIThreadStatusReport pReport, PrometheusDataSet pData) throws OceanusException Load items from the list into the table.- Parameters:
pReport- the reportpData- the data- Throws:
OceanusException- on error
-
insertItems
protected void insertItems(TethysUIThreadStatusReport pReport, PrometheusDataSet pData, PrometheusBatchControl pBatch) throws OceanusException Insert new items from the list.- Parameters:
pReport- the reportpData- the datapBatch- the batch control- Throws:
OceanusException- on error
-
updateItems
protected void updateItems(TethysUIThreadStatusReport pReport, PrometheusBatchControl pBatch) throws OceanusException Update items from the list.- Parameters:
pReport- the reportpBatch- the batch control- Throws:
OceanusException- on error
-
deleteItems
protected void deleteItems(TethysUIThreadStatusReport pReport, PrometheusBatchControl pBatch) throws OceanusException Delete items from the list.- Parameters:
pReport- the reportpBatch- the batch control- Throws:
OceanusException- on error
-
createTable
Create the table.- Throws:
OceanusException- on error
-
createDatabase
Create the database.- Parameters:
pDatabase- the database name- Throws:
OceanusException- on error
-
dropTable
Drop the table.- Throws:
OceanusException- on error
-
purgeTable
Truncate the table.- Throws:
OceanusException- on error
-
getRowValues
Obtain row values.- Parameters:
pName- the name of the item- Returns:
- the row values.
- Throws:
OceanusException- on error
-