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

public abstract class PrometheusColumnDefinition extends Object
Column definition classes handling data-type specifics.
Author:
Tony Washer
  • Constructor Details

  • Method Details

    • getColumnName

      protected String getColumnName()
      Obtain the column name.
      Returns:
      the name
    • getColumnId

      protected MetisDataItem.MetisDataFieldId getColumnId()
      Obtain the column id.
      Returns:
      the id
    • getSortOrder

      Obtain the sort order.
      Returns:
      the sort order
    • getObject

      protected Object getObject()
      Obtain the value.
      Returns:
      the value
    • getTable

      protected PrometheusTableDefinition getTable()
      Obtain the table.
      Returns:
      the table
    • getDriver

      protected PrometheusJDBCDriver getDriver()
      Obtain the value.
      Returns:
      the value
    • clearValue

      protected void clearValue()
      Clear value.
    • setObject

      protected void setObject(Object pValue)
      Set value.
      Parameters:
      pValue - the value
    • isValueSet

      protected boolean isValueSet()
      Is the value set.
      Returns:
      true/false
    • buildCreateString

      protected void buildCreateString(StringBuilder pBuilder)
      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

      public void setSortOrder(PrometheusTableDefinition.PrometheusSortOrder pOrder)
      Set sortOrder.
      Parameters:
      pOrder - the Sort direction
    • buildColumnType

      protected abstract void buildColumnType(StringBuilder pBuilder)
      Build the column type for this column.
      Parameters:
      pBuilder - the String builder
    • loadValue

      protected abstract void loadValue(ResultSet pResults, int pIndex) throws SQLException
      Load the value for this column.
      Parameters:
      pResults - the results
      pIndex - the index of the result column
      Throws:
      SQLException - on error
    • storeValue

      protected abstract void storeValue(PreparedStatement pStatement, int pIndex) throws SQLException
      Store the value for this column.
      Parameters:
      pStatement - the prepared statement
      pIndex - the index of the statement
      Throws:
      SQLException - on error
    • buildKeyReference

      protected void buildKeyReference(StringBuilder pBuilder)
      Define the key reference.
      Parameters:
      pBuilder - the String builder
    • locateReference

      protected void locateReference(List<PrometheusTableDataItem<?>> pTables)
      Locate reference.
      Parameters:
      pTables - the list of defined tables