APIdia Launch Partner
Top Description Fields Methods
io.github.spannm.jackcess

public Interface Column

Known Direct Implementers
io.github.spannm.jackcess.impl.ColumnImpl
Imports
io.github.spannm.jackcess.complex.ComplexColumnInfo, .ComplexValue, io.github.spannm.jackcess.util.ColumnValidator, java.io.IOException, java.util.Map

Access database column definition. A Table has a list of Column instances describing the table schema.

A Column instance is not thread-safe (see Database for more thread-safety details).

Field Summary

Modifier and TypeField and Description
public static final Object
AUTO_NUMBER

Meaningless placeholder object for inserting values in an autonumber column.

public static final Object
KEEP_VALUE

Meaningless placeholder object for updating rows which indicates that a given column should keep its existing value.

Method Summary

Modifier and TypeMethod and Description
public int
getColumnIndex()

Returns the position of this column within its table, i.e. the index at which this column's value is stored in the Object[] row arrays accepted/returned by getRowValue(Object[]) and setRowValue(Object[], Object).

public ColumnValidator
getColumnValidator()

Gets currently configured ColumnValidator (always non-null).

public ComplexColumnInfo<? extends ComplexValue>
getComplexInfo()

Returns extended functionality for "complex" columns.

public Database

Returns:

the database to which this column's table belongs
getDatabase
()

Returns the database to which this column's table belongs.

public short

Returns:

the length of this column in bytes, as stored in the database
getLength
()

Returns the length of this column in bytes, as stored in the database.

public short

Returns:

the length of this column in "units" appropriate for its type (e.g. characters for TEXT columns), which may differ from getLength() for columns whose storage unit is wider than one byte
getLengthInUnits
()

Returns the length of this column in "units" appropriate for its type (e.g. characters for TEXT columns), which may differ from getLength() for columns whose storage unit is wider than one byte.

public String

Returns:

the name of this column
getName
()

Returns the name of this column.

public byte

Returns:

the numeric precision of this column (only meaningful for DataTypes NUMERIC and MONEY)
getPrecision
()

Returns the numeric precision of this column (only meaningful for DataTypes NUMERIC and MONEY).

public PropertyMap

Returns:

the properties for this column
getProperties
()

Returns the properties for this column.

public Object

Returns:

this column's value at the position given by getColumnIndex() within rowArray
getRowValue
(Object[]
a row value array, indexed by getColumnIndex()
rowArray
)

Returns this column's value at the position given by getColumnIndex() within rowArray.

public Object

Returns:

this column's value, keyed by getName(), within rowMap
getRowValue
(Map<String, ?>
a row value map, keyed by column name
rowMap
)

Returns this column's value, keyed by getName(), within rowMap.

public byte

Returns:

the numeric scale of this column (only meaningful for DataTypes NUMERIC and MONEY)
getScale
()

Returns the numeric scale of this column (only meaningful for DataTypes NUMERIC and MONEY).

public int

Returns:

the java.sql.Types constant corresponding to this column's DataType
getSQLType
()

Returns the java.sql.Types constant corresponding to this column's DataType.

public Table

Returns:

the table to which this column belongs
getTable
()

Returns the table to which this column belongs.

public DataType

Returns:

the data type of this column
getType
()

Returns the data type of this column.

public Column
getVersionHistoryColumn()

Returns the column which tracks the version history for an "append only" column.

public boolean
isAppendOnly()

Whether or not this column is "append only" (its history is tracked by a separate version history column).

public boolean

Returns:

true if this is an autonumber column, whose values are assigned automatically by the database
isAutoNumber
()

Returns true if this is an autonumber column, whose values are assigned automatically by the database.

public boolean
isCalculated()

Returns whether or not this is a calculated column.

public boolean

Returns:

true if this text column uses compressed unicode storage, false otherwise (not applicable to non-text columns)
isCompressedUnicode
()

Returns true if this text column uses compressed unicode storage, false otherwise (not applicable to non-text columns).

public boolean

Returns:

true if this column's values are variable-length (e.g. TEXT, MEMO, BINARY), false if fixed-length (e.g. LONG, DOUBLE)
isVariableLength
()

Returns true if this column's values are variable-length (e.g. TEXT, MEMO, BINARY), false if fixed-length (e.g. LONG, DOUBLE).

public void
setColumnValidator(ColumnValidator newValidator)

Sets a new ColumnValidator.

public Object

Returns:

the previous value at that position
setRowValue
(Object[]
a row value array, indexed by getColumnIndex()
rowArray
,
Object
the new value for this column
value
)

Sets this column's value at the position given by getColumnIndex() within rowArray.

public Object

Returns:

the previous value for this column's name
setRowValue
(Map<String, Object>
a row value map, keyed by column name
rowMap
,
Object
the new value for this column
value
)

Sets this column's value, keyed by getName(), within rowMap.

Field Detail

AUTO_NUMBERback to summary
public static final Object AUTO_NUMBER

Meaningless placeholder object for inserting values in an autonumber column. it is not required that this value be used (any passed in value is ignored), but using this placeholder may make code more obvious.

KEEP_VALUEback to summary
public static final Object KEEP_VALUE

Meaningless placeholder object for updating rows which indicates that a given column should keep its existing value.

Method Detail

getColumnIndexback to summary
public int getColumnIndex()

Returns the position of this column within its table, i.e. the index at which this column's value is stored in the Object[] row arrays accepted/returned by getRowValue(Object[]) and setRowValue(Object[], Object).

getColumnValidatorback to summary
public ColumnValidator getColumnValidator()

Gets currently configured ColumnValidator (always non-null).

getComplexInfoback to summary
public ComplexColumnInfo<? extends ComplexValue> getComplexInfo()

Returns extended functionality for "complex" columns.

getDatabaseback to summary
public Database getDatabase()

Returns the database to which this column's table belongs.

Returns:Database

the database to which this column's table belongs

getLengthback to summary
public short getLength()

Returns the length of this column in bytes, as stored in the database.

Returns:short

the length of this column in bytes, as stored in the database

getLengthInUnitsback to summary
public short getLengthInUnits()

Returns the length of this column in "units" appropriate for its type (e.g. characters for TEXT columns), which may differ from getLength() for columns whose storage unit is wider than one byte.

Returns:short

the length of this column in "units" appropriate for its type (e.g. characters for TEXT columns), which may differ from getLength() for columns whose storage unit is wider than one byte

getNameback to summary
public String getName()

Returns the name of this column.

Returns:String

the name of this column

getPrecisionback to summary
public byte getPrecision()

Returns the numeric precision of this column (only meaningful for DataTypes NUMERIC and MONEY).

Returns:byte

the numeric precision of this column (only meaningful for DataTypes NUMERIC and MONEY)

getPropertiesback to summary
public PropertyMap getProperties() throws IOException

Returns the properties for this column.

Returns:PropertyMap

the properties for this column

getRowValueback to summary
public Object getRowValue(Object[] rowArray)

Returns this column's value at the position given by getColumnIndex() within rowArray.

Parameters
rowArray:Object[]

a row value array, indexed by getColumnIndex()

Returns:Object

this column's value at the position given by getColumnIndex() within rowArray

getRowValueback to summary
public Object getRowValue(Map<String, ?> rowMap)

Returns this column's value, keyed by getName(), within rowMap.

Parameters
rowMap:Map<String, ?>

a row value map, keyed by column name

Returns:Object

this column's value, keyed by getName(), within rowMap

getScaleback to summary
public byte getScale()

Returns the numeric scale of this column (only meaningful for DataTypes NUMERIC and MONEY).

Returns:byte

the numeric scale of this column (only meaningful for DataTypes NUMERIC and MONEY)

getSQLTypeback to summary
public int getSQLType() throws IOException

Returns the java.sql.Types constant corresponding to this column's DataType.

Returns:int

the java.sql.Types constant corresponding to this column's DataType

getTableback to summary
public Table getTable()

Returns the table to which this column belongs.

Returns:Table

the table to which this column belongs

getTypeback to summary
public DataType getType()

Returns the data type of this column.

Returns:DataType

the data type of this column

getVersionHistoryColumnback to summary
public Column getVersionHistoryColumn()

Returns the column which tracks the version history for an "append only" column.

isAppendOnlyback to summary
public boolean isAppendOnly()

Whether or not this column is "append only" (its history is tracked by a separate version history column).

isAutoNumberback to summary
public boolean isAutoNumber()

Returns true if this is an autonumber column, whose values are assigned automatically by the database.

Returns:boolean

true if this is an autonumber column, whose values are assigned automatically by the database

isCalculatedback to summary
public boolean isCalculated()

Returns whether or not this is a calculated column. Note that jackess won't interpret the calculation expression (but the field can be written directly).

isCompressedUnicodeback to summary
public boolean isCompressedUnicode()

Returns true if this text column uses compressed unicode storage, false otherwise (not applicable to non-text columns).

Returns:boolean

true if this text column uses compressed unicode storage, false otherwise (not applicable to non-text columns)

isVariableLengthback to summary
public boolean isVariableLength()

Returns true if this column's values are variable-length (e.g. TEXT, MEMO, BINARY), false if fixed-length (e.g. LONG, DOUBLE).

Returns:boolean

true if this column's values are variable-length (e.g. TEXT, MEMO, BINARY), false if fixed-length (e.g. LONG, DOUBLE)

setColumnValidatorback to summary
public void setColumnValidator(ColumnValidator newValidator)

Sets a new ColumnValidator. If null, resets to the value returned from the Database's ColumnValidatorFactory (if the factory returns null, then the default is used). Autonumber columns cannot have a validator instance other than the default.

Exceptions
IllegalArgumentException:
if an attempt is made to set a non-null ColumnValidator instance on an autonumber column
setRowValueback to summary
public Object setRowValue(Object[] rowArray, Object value)

Sets this column's value at the position given by getColumnIndex() within rowArray.

Parameters
rowArray:Object[]

a row value array, indexed by getColumnIndex()

value:Object

the new value for this column

Returns:Object

the previous value at that position

Annotations
@SuppressWarnings:PMD.LinguisticNaming
setRowValueback to summary
public Object setRowValue(Map<String, Object> rowMap, Object value)

Sets this column's value, keyed by getName(), within rowMap.

Parameters
rowMap:Map<String, Object>

a row value map, keyed by column name

value:Object

the new value for this column

Returns:Object

the previous value for this column's name

Annotations
@SuppressWarnings:PMD.LinguisticNaming