Class ColumnImpl
- 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 ColumnMetaDatagetColumnMetaData()Accessor for the metadata for this column (if any).ColumnTypegetColumnType()Accessor for the role that this column serves (if known).ObjectgetDefaultValue()Accessor for the default ValueJdbcTypegetJdbcType()Accessor for the JDBC Type used for this column.MemberColumnMappinggetMemberColumnMapping()Accessor for the mapping (and hence member) that owns this column.StringgetName()Accessor for the column name.intgetPosition()Accessor for the position of this column in the table (if specified).TablegetTable()Accessor for the table for this column.StringgetTypeName()Accessor for the native type name in the datastore for this column.booleanisDefaultable()Accessor for whether the column is defaultable.booleanisNested()booleanisNullable()Accessor for whether the column is nullable in the datastore.booleanisPrimaryKey()Whether this column is (part of) the primary keybooleanisUnique()Accessor for whether the column is unique.ColumnsetColumnMetaData(ColumnMetaData md)ColumnsetDefaultable(Object defaultValue)Mutator for the defaultability of the column.ColumnsetJdbcType(JdbcType type)voidsetMemberColumnMapping(MemberColumnMapping mapping)voidsetNested(boolean nested)ColumnsetNullable(boolean flag)Mutator for the nullability of the column.ColumnsetPosition(int pos)ColumnsetPrimaryKey()Mutator to make the column (part of) the primary key.ColumnsetTypeName(String type)ColumnsetUnique(boolean flag)Mutator for the uniqueness of the column.StringtoString()
-
-
-
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:ColumnAccessor for the table for this column.
-
getMemberColumnMapping
public MemberColumnMapping getMemberColumnMapping()
Description copied from interface:ColumnAccessor for the mapping (and hence member) that owns this column.- Specified by:
getMemberColumnMappingin 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:ColumnAccessor for the column name.
-
isPrimaryKey
public boolean isPrimaryKey()
Description copied from interface:ColumnWhether this column is (part of) the primary key- Specified by:
isPrimaryKeyin interfaceColumn- Returns:
- Whether part of the PK
-
setPrimaryKey
public Column setPrimaryKey()
Description copied from interface:ColumnMutator to make the column (part of) the primary key.- Specified by:
setPrimaryKeyin interfaceColumn- Returns:
- This column
-
setNullable
public Column setNullable(boolean flag)
Description copied from interface:ColumnMutator for the nullability of the column.- Specified by:
setNullablein interfaceColumn- Parameters:
flag- Whether this is nullable- Returns:
- The column with the updated info
-
isNullable
public boolean isNullable()
Description copied from interface:ColumnAccessor for whether the column is nullable in the datastore.- Specified by:
isNullablein interfaceColumn- Returns:
- whether the column is nullable
-
setDefaultable
public Column setDefaultable(Object defaultValue)
Description copied from interface:ColumnMutator for the defaultability of the column.- Specified by:
setDefaultablein interfaceColumn- Parameters:
defaultValue- The default to use- Returns:
- The column with the updated info
-
isDefaultable
public boolean isDefaultable()
Description copied from interface:ColumnAccessor for whether the column is defaultable.- Specified by:
isDefaultablein interfaceColumn- Returns:
- whether the column is defaultable
-
getDefaultValue
public Object getDefaultValue()
Description copied from interface:ColumnAccessor for the default Value- Specified by:
getDefaultValuein interfaceColumn- Returns:
- the default value
-
setUnique
public Column setUnique(boolean flag)
Description copied from interface:ColumnMutator for the uniqueness of the column.
-
isUnique
public boolean isUnique()
Description copied from interface:ColumnAccessor for whether the column is unique.
-
getColumnType
public ColumnType getColumnType()
Description copied from interface:ColumnAccessor for the role that this column serves (if known).- Specified by:
getColumnTypein interfaceColumn- Returns:
- Role of the column
-
setJdbcType
public Column setJdbcType(JdbcType type)
- Specified by:
setJdbcTypein interfaceColumn
-
getJdbcType
public JdbcType getJdbcType()
Description copied from interface:ColumnAccessor for the JDBC Type used for this column.- Specified by:
getJdbcTypein interfaceColumn- Returns:
- The Jdbc type
-
setTypeName
public Column setTypeName(String type)
- Specified by:
setTypeNamein interfaceColumn
-
getTypeName
public String getTypeName()
Description copied from interface:ColumnAccessor for the native type name in the datastore for this column.- Specified by:
getTypeNamein interfaceColumn- Returns:
- The column type name
-
setPosition
public Column setPosition(int pos)
- Specified by:
setPositionin interfaceColumn
-
getPosition
public int getPosition()
Description copied from interface:ColumnAccessor for the position of this column in the table (if specified).- Specified by:
getPositionin interfaceColumn- Returns:
- The position, or -1 if not specified
-
setColumnMetaData
public Column setColumnMetaData(ColumnMetaData md)
- Specified by:
setColumnMetaDatain interfaceColumn
-
getColumnMetaData
public ColumnMetaData getColumnMetaData()
Description copied from interface:ColumnAccessor for the metadata for this column (if any).- Specified by:
getColumnMetaDatain interfaceColumn- Returns:
- Metadata for the column
-
-