Class SmallIntColumnMapping

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

public class SmallIntColumnMapping extends AbstractColumnMapping
Mapping of a SMALLINT column.
  • Constructor Details

  • Method Details

    • initialize

      private void initialize()
      Initialise the mapping.
    • 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"
    • setBoolean

      public void setBoolean(PreparedStatement ps, int param, boolean value)
      Setter for when we are storing a boolean field as a SMALLINT.
      Specified by:
      setBoolean in interface ColumnMapping
      Overrides:
      setBoolean in class AbstractColumnMapping
      Parameters:
      ps - Prepared Statement
      param - Number of the parameter in the statement
      value - The boolean value
    • getBoolean

      public boolean getBoolean(ResultSet rs, int param)
      Getter for when we are storing a boolean field as a SMALLINT.
      Specified by:
      getBoolean in interface ColumnMapping
      Overrides:
      getBoolean in class AbstractColumnMapping
      Parameters:
      rs - Result Set from which to get the boolean
      param - Number of the parameter in the statement
      Returns:
      The boolean 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
    • 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
    • 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
    • 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
    • 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)
      Description copied from interface: ColumnMapping
      Obtains a value from resultSet at position specified by exprIndex.
      Specified by:
      getObject in interface ColumnMapping
      Overrides:
      getObject in class AbstractColumnMapping
      Parameters:
      rs - ResultSet
      param - the position of the value in the result
      Returns:
      the value