Class NumericColumnMapping

java.lang.Object
org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
org.datanucleus.store.rdbms.mapping.column.NumericColumnMapping
All Implemented Interfaces:
ColumnMapping

public class NumericColumnMapping extends AbstractColumnMapping
Mapping of a numeric column.
  • Field Details

    • INT_MAX_DECIMAL_DIGITS

      private static final int INT_MAX_DECIMAL_DIGITS
      See Also:
  • Constructor Details

  • Method Details

    • initialize

      private void initialize()
      Initialise the mapping, setting any default precision.
    • isIntegerBased

      public boolean isIntegerBased()
      Accessor for whether the mapping is integer-based.
      Specified by:
      isIntegerBased in interface ColumnMapping
      Overrides:
      isIntegerBased in class AbstractColumnMapping
      Returns:
      Whether the mapping is integer based
    • getJDBCType

      public int getJDBCType()
      Description copied from class: AbstractColumnMapping
      Method to return the java.sql.Types type that this relates to.
      Specified by:
      getJDBCType in class AbstractColumnMapping
      Returns:
      The JDBC "type"
    • setChar

      public void setChar(PreparedStatement ps, int param, char value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setChar in interface ColumnMapping
      Overrides:
      setChar in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getChar

      public char getChar(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getChar in interface ColumnMapping
      Overrides:
      getChar in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setInt

      public void setInt(PreparedStatement ps, int param, int value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setInt in interface ColumnMapping
      Overrides:
      setInt in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getInt

      public int getInt(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getInt in interface ColumnMapping
      Overrides:
      getInt in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setByte

      public void setByte(PreparedStatement ps, int param, byte value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setByte in interface ColumnMapping
      Overrides:
      setByte in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getByte

      public byte getByte(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getByte in interface ColumnMapping
      Overrides:
      getByte in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setBoolean

      public void setBoolean(PreparedStatement ps, int param, boolean value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setBoolean in interface ColumnMapping
      Overrides:
      setBoolean in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getBoolean

      public boolean getBoolean(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getBoolean in interface ColumnMapping
      Overrides:
      getBoolean in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setDouble

      public void setDouble(PreparedStatement ps, int param, double value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setDouble in interface ColumnMapping
      Overrides:
      setDouble in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getDouble

      public double getDouble(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getDouble in interface ColumnMapping
      Overrides:
      getDouble in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setFloat

      public void setFloat(PreparedStatement ps, int param, float value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setFloat in interface ColumnMapping
      Overrides:
      setFloat in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getFloat

      public float getFloat(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getFloat in interface ColumnMapping
      Overrides:
      getFloat in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setShort

      public void setShort(PreparedStatement ps, int param, short value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setShort in interface ColumnMapping
      Overrides:
      setShort in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getShort

      public short getShort(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getShort in interface ColumnMapping
      Overrides:
      getShort in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setLong

      public void setLong(PreparedStatement ps, int param, long value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setLong in interface ColumnMapping
      Overrides:
      setLong in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getLong

      public long getLong(ResultSet rs, int param)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getLong in interface ColumnMapping
      Overrides:
      getLong in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value
    • setObject

      public void setObject(PreparedStatement ps, int param, Object value)
      Description copied from interface: ColumnMapping
      Sets a value into ps at position specified by paramIndex.
      Specified by:
      setObject in interface ColumnMapping
      Overrides:
      setObject in class AbstractColumnMapping
      Parameters:
      ps - PreparedStatement
      param - the position of the value in the statement
      value - the value
    • getObject

      public Object getObject(ResultSet rs, int param)
      Accessor for the value from a result set.
      Specified by:
      getObject in interface ColumnMapping
      Overrides:
      getObject in class AbstractColumnMapping
      Parameters:
      rs - Result Set
      param - Position in result set
      Returns:
      The value of the object