Class ColumnImpl

java.lang.Object
org.datanucleus.store.schema.table.ColumnImpl
All Implemented Interfaces:
Column

public class ColumnImpl extends Object implements Column
Representation of a column in a table.
  • Field Details

    • table

      Table table
    • columnType

      ColumnType columnType
    • identifier

      String identifier
    • primaryKey

      boolean primaryKey
    • nullable

      boolean nullable
    • defaultable

      boolean defaultable
    • defaultValue

      Object defaultValue
    • unique

      boolean unique
    • jdbcType

      JdbcType jdbcType
    • typeName

      String typeName
    • position

      int position
    • mapping

    • colmd

    • nested

      boolean nested
  • Constructor Details

  • Method Details

    • isNested

      public boolean isNested()
    • setNested

      public void setNested(boolean nested)
    • getTable

      public Table getTable()
      Description copied from interface: Column
      Accessor for the table for this column.
      Specified by:
      getTable in interface Column
      Returns:
      The table
    • getMemberColumnMapping

      public MemberColumnMapping getMemberColumnMapping()
      Description copied from interface: Column
      Accessor for the mapping (and hence member) that owns this column.
      Specified by:
      getMemberColumnMapping in interface Column
      Returns:
      The associated mapping (or null if this is a surrogate column)
    • setMemberColumnMapping

      public void setMemberColumnMapping(MemberColumnMapping mapping)
    • getName

      public String getName()
      Description copied from interface: Column
      Accessor for the column name.
      Specified by:
      getName in interface Column
      Returns:
      Name of column
    • isPrimaryKey

      public boolean isPrimaryKey()
      Description copied from interface: Column
      Whether this column is (part of) the primary key
      Specified by:
      isPrimaryKey in interface Column
      Returns:
      Whether part of the PK
    • setPrimaryKey

      public Column setPrimaryKey()
      Description copied from interface: Column
      Mutator to make the column (part of) the primary key.
      Specified by:
      setPrimaryKey in interface Column
      Returns:
      This column
    • setNullable

      public Column setNullable(boolean flag)
      Description copied from interface: Column
      Mutator for the nullability of the column.
      Specified by:
      setNullable in interface Column
      Parameters:
      flag - Whether this is nullable
      Returns:
      The column with the updated info
    • isNullable

      public boolean isNullable()
      Description copied from interface: Column
      Accessor for whether the column is nullable in the datastore.
      Specified by:
      isNullable in interface Column
      Returns:
      whether the column is nullable
    • setDefaultable

      public Column setDefaultable(Object defaultValue)
      Description copied from interface: Column
      Mutator for the defaultability of the column.
      Specified by:
      setDefaultable in interface Column
      Parameters:
      defaultValue - The default to use
      Returns:
      The column with the updated info
    • isDefaultable

      public boolean isDefaultable()
      Description copied from interface: Column
      Accessor for whether the column is defaultable.
      Specified by:
      isDefaultable in interface Column
      Returns:
      whether the column is defaultable
    • getDefaultValue

      public Object getDefaultValue()
      Description copied from interface: Column
      Accessor for the default Value
      Specified by:
      getDefaultValue in interface Column
      Returns:
      the default value
    • setUnique

      public Column setUnique(boolean flag)
      Description copied from interface: Column
      Mutator for the uniqueness of the column.
      Specified by:
      setUnique in interface Column
      Parameters:
      flag - The flag
      Returns:
      The column with the updated info
    • isUnique

      public boolean isUnique()
      Description copied from interface: Column
      Accessor for whether the column is unique.
      Specified by:
      isUnique in interface Column
      Returns:
      whether the column is unique
    • getColumnType

      public ColumnType getColumnType()
      Description copied from interface: Column
      Accessor for the role that this column serves (if known).
      Specified by:
      getColumnType in interface Column
      Returns:
      Role of the column
    • setJdbcType

      public Column setJdbcType(JdbcType type)
      Specified by:
      setJdbcType in interface Column
    • getJdbcType

      public JdbcType getJdbcType()
      Description copied from interface: Column
      Accessor for the JDBC Type used for this column.
      Specified by:
      getJdbcType in interface Column
      Returns:
      The Jdbc type
    • setTypeName

      public Column setTypeName(String type)
      Specified by:
      setTypeName in interface Column
    • getTypeName

      public String getTypeName()
      Description copied from interface: Column
      Accessor for the native type name in the datastore for this column.
      Specified by:
      getTypeName in interface Column
      Returns:
      The column type name
    • setPosition

      public Column setPosition(int pos)
      Specified by:
      setPosition in interface Column
    • getPosition

      public int getPosition()
      Description copied from interface: Column
      Accessor for the position of this column in the table (if specified).
      Specified by:
      getPosition in interface Column
      Returns:
      The position, or -1 if not specified
    • setColumnMetaData

      public Column setColumnMetaData(ColumnMetaData md)
      Specified by:
      setColumnMetaData in interface Column
    • getColumnMetaData

      public ColumnMetaData getColumnMetaData()
      Description copied from interface: Column
      Accessor for the metadata for this column (if any).
      Specified by:
      getColumnMetaData in interface Column
      Returns:
      Metadata for the column
    • toString

      public String toString()
      Overrides:
      toString in class Object