Class PrometheusColumnDefinition
java.lang.Object
io.github.tonywasher.joceanus.prometheus.database.PrometheusColumnDefinition
- Direct Known Subclasses:
PrometheusColumnDefinition.PrometheusBinaryColumn,PrometheusColumnDefinition.PrometheusBooleanColumn,PrometheusColumnDefinition.PrometheusDateColumn,PrometheusColumnDefinition.PrometheusIntegerColumn,PrometheusColumnDefinition.PrometheusLongColumn,PrometheusColumnDefinition.PrometheusShortColumn,PrometheusColumnDefinition.PrometheusStringColumn
Column definition classes handling data-type specifics.
- Author:
- Tony Washer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classThe binaryColumn Class.protected static final classThe booleanColumn Class.protected static final classThe dateColumn Class.protected static final classThe idColumn Class.protected static classThe integerColumn Class.protected static final classThe longColumn Class.protected static final classThe moneyColumn Class.protected static final classThe priceColumn Class.protected static final classThe rateColumn Class.protected static final classThe ratioColumn Class.protected static final classThe referenceColumn Class.protected static final classThe shortColumn Class.protected static classThe stringColumn Class.protected static final classThe unitsColumn Class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbuildColumnType(StringBuilder pBuilder) Build the column type for this column.protected voidbuildCreateString(StringBuilder pBuilder) Build the creation string for this column.protected voidbuildKeyReference(StringBuilder pBuilder) Define the key reference.protected voidClear value.protected MetisDataItem.MetisDataFieldIdObtain the column id.protected StringObtain the column name.protected PrometheusJDBCDriverObtain the value.protected ObjectObtain the value.Obtain the sort order.protected PrometheusTableDefinitiongetTable()Obtain the table.protected booleanIs the value set.protected abstract voidLoad the value for this column.protected voidlocateReference(List<PrometheusTableDataItem<?>> pTables) Locate reference.protected voidSet null-able column.protected voidSet value.protected voidNote that we have a sort on reference.voidSet sortOrder.protected abstract voidstoreValue(PreparedStatement pStatement, int pIndex) Store the value for this column.
-
Constructor Details
-
PrometheusColumnDefinition
protected PrometheusColumnDefinition(PrometheusTableDefinition pTable, MetisDataItem.MetisDataFieldId pId) Constructor.- Parameters:
pTable- the table to which the column belongspId- the column id
-
-
Method Details
-
getColumnName
Obtain the column name.- Returns:
- the name
-
getColumnId
Obtain the column id.- Returns:
- the id
-
getSortOrder
Obtain the sort order.- Returns:
- the sort order
-
getObject
Obtain the value.- Returns:
- the value
-
getTable
Obtain the table.- Returns:
- the table
-
getDriver
Obtain the value.- Returns:
- the value
-
clearValue
protected void clearValue()Clear value. -
setObject
Set value.- Parameters:
pValue- the value
-
isValueSet
protected boolean isValueSet()Is the value set.- Returns:
- true/false
-
buildCreateString
Build the creation string for this column.- Parameters:
pBuilder- the String builder
-
setNullable
protected void setNullable()Set null-able column. -
setSortOnReference
protected void setSortOnReference()Note that we have a sort on reference. -
setSortOrder
Set sortOrder.- Parameters:
pOrder- the Sort direction
-
buildColumnType
Build the column type for this column.- Parameters:
pBuilder- the String builder
-
loadValue
Load the value for this column.- Parameters:
pResults- the resultspIndex- the index of the result column- Throws:
SQLException- on error
-
storeValue
Store the value for this column.- Parameters:
pStatement- the prepared statementpIndex- the index of the statement- Throws:
SQLException- on error
-
buildKeyReference
Define the key reference.- Parameters:
pBuilder- the String builder
-
locateReference
Locate reference.- Parameters:
pTables- the list of defined tables
-