- java.lang.Object
-
- org.datanucleus.store.schema.table.ColumnImpl
-
-
Constructor Summary
Constructors Constructor Description ColumnImpl(Table tbl, String identifier, ColumnType colType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnMetaData
getColumnMetaData()
Accessor for the metadata for this column (if any).ColumnType
getColumnType()
Accessor for the role that this column serves (if known).Object
getDefaultValue()
Accessor for the default ValueJdbcType
getJdbcType()
Accessor for the JDBC Type used for this column.MemberColumnMapping
getMemberColumnMapping()
Accessor for the mapping (and hence member) that owns this column.String
getName()
Accessor for the column name.int
getPosition()
Accessor for the position of this column in the table (if specified).Table
getTable()
Accessor for the table for this column.String
getTypeName()
Accessor for the native type name in the datastore for this column.boolean
isDefaultable()
Accessor for whether the column is defaultable.boolean
isNested()
boolean
isNullable()
Accessor for whether the column is nullable in the datastore.boolean
isPrimaryKey()
Whether this column is (part of) the primary keyboolean
isUnique()
Accessor for whether the column is unique.Column
setColumnMetaData(ColumnMetaData md)
Column
setDefaultable(Object defaultValue)
Mutator for the defaultability of the column.Column
setJdbcType(JdbcType type)
void
setMemberColumnMapping(MemberColumnMapping mapping)
void
setNested(boolean nested)
Column
setNullable(boolean flag)
Mutator for the nullability of the column.Column
setPosition(int pos)
Column
setPrimaryKey()
Mutator to make the column (part of) the primary key.Column
setTypeName(String type)
Column
setUnique(boolean flag)
Mutator for the uniqueness of the column.String
toString()
-
-
-
Constructor Detail
-
ColumnImpl
public ColumnImpl(Table tbl, String identifier, ColumnType colType)
-
-
Method Detail
-
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.
-
getMemberColumnMapping
public MemberColumnMapping getMemberColumnMapping()
Description copied from interface:Column
Accessor for the mapping (and hence member) that owns this column.- Specified by:
getMemberColumnMapping
in interfaceColumn
- 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.
-
isPrimaryKey
public boolean isPrimaryKey()
Description copied from interface:Column
Whether this column is (part of) the primary key- Specified by:
isPrimaryKey
in interfaceColumn
- 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 interfaceColumn
- 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 interfaceColumn
- 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 interfaceColumn
- 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 interfaceColumn
- 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 interfaceColumn
- Returns:
- whether the column is defaultable
-
getDefaultValue
public Object getDefaultValue()
Description copied from interface:Column
Accessor for the default Value- Specified by:
getDefaultValue
in interfaceColumn
- Returns:
- the default value
-
setUnique
public Column setUnique(boolean flag)
Description copied from interface:Column
Mutator for the uniqueness of the column.
-
isUnique
public boolean isUnique()
Description copied from interface:Column
Accessor for 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 interfaceColumn
- Returns:
- Role of the column
-
setJdbcType
public Column setJdbcType(JdbcType type)
- Specified by:
setJdbcType
in interfaceColumn
-
getJdbcType
public JdbcType getJdbcType()
Description copied from interface:Column
Accessor for the JDBC Type used for this column.- Specified by:
getJdbcType
in interfaceColumn
- Returns:
- The Jdbc type
-
setTypeName
public Column setTypeName(String type)
- Specified by:
setTypeName
in interfaceColumn
-
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 interfaceColumn
- Returns:
- The column type name
-
setPosition
public Column setPosition(int pos)
- Specified by:
setPosition
in interfaceColumn
-
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 interfaceColumn
- Returns:
- The position, or -1 if not specified
-
setColumnMetaData
public Column setColumnMetaData(ColumnMetaData md)
- Specified by:
setColumnMetaData
in interfaceColumn
-
getColumnMetaData
public ColumnMetaData getColumnMetaData()
Description copied from interface:Column
Accessor for the metadata for this column (if any).- Specified by:
getColumnMetaData
in interfaceColumn
- Returns:
- Metadata for the column
-
-