Abstract
This class represents a column in an NDB Cluster table.
Parent class. NdbDictionary
Child classes. None
Description.
Each instance of the Column
is characterised by
its type, which is determined by a number of type specifiers:
Built-in type
Array length or maximum length
Precision and scale (currently not in use)
Character set (applicable only to columns using string datatypes)
Inline and part sizes (applicable only to
BLOB
columns)
These types in general correspond to MySQL datatypes and their
variants. The data formats are same as in MySQL. The NDB API
provides no support for constructing such formats; however, they
are checked by the NDB
kernel.
Methods. The following table lists the public methods of this class and the purpose or use of each method:
Method | Purpose / Use |
---|---|
getName() |
Gets the name of the column |
getNullable() |
Checks whether the column can be set to NULL
|
getPrimaryKey() |
Check whether the column is part of the table's primary key |
getColumnNo() |
Gets the column number |
equal() |
Compares Column objects |
getType() |
Gets the column's type (Type value) |
getLength() |
Gets the column's length |
getCharset() |
Get the character set used by a string (text) column (not applicable to columns not storing character data) |
getInlineSize() |
Gets the inline size of a BLOB column (not applicable
to other column types) |
getPartSize() |
Gets the part size of a BLOB column (not applicable
to other column types) |
getStripeSize() |
Gets a BLOB column's stripe size (not applicable to other column types) |
getSize() |
Gets the size of an element |
getPartitionKey() |
Checks whether the column is part of the table's partitioning key |
getArrayType() |
Gets the column's array type |
getStorageType() |
Gets the storage type used by this column |
getPrecision() |
Gets the column's precision (used for decimal types only) |
getScale() |
Gets the column's scale (used for decimal types only) |
Column() |
Class constructor; there is also a copy constructor |
~Column() |
Class destructor |
setName() |
Sets the column's name |
setNullable() |
Toggles the column's nullability |
setPrimaryKey() |
Determines whether the column is part of the primary key |
setType() |
Sets the column's Type
|
setLength() |
Sets the column's length |
setCharset() |
Sets the character set used by a column containing character data (not applicable to nontextual columns) |
setInlineSize() |
Sets the inline size for a BLOB column (not
applicable to non-BLOB columns) |
setPartSize() |
Sets the part size for a BLOB column (not applicable
to non-BLOB columns) |
setStripeSize() |
Sets the stripe size for a BLOB column (not
applicable to non-BLOB columns) |
setPartitionKey() |
Determines whether the column is part of the table's partitioning key |
setArrayType() |
Sets the column's ArrayType
|
setStorageType() |
Sets the storage type to be used by this column |
setPrecision() |
Sets the column's precision (used for decimal types only) |
setScale() |
Sets the column's scale (used for decimal types only) |
setDefaultValue() |
Sets the column's default value |
getDefaultValue() |
Returns the column's default value |
For detailed descriptions, signatures, and examples of use for each
of these methods, see Section 2.3.1.2, “Column
Methods”.
In the NDB API, column names are handled in case-sensitive fashion. (This differs from the MySQL C API.) To reduce the possibility for error, it is recommended that you name all columns consistently using uppercase or lowercase.
Types.
These are the public types of the Column
class:
Type | Purpose / Use |
---|---|
ArrayType |
Specifies the column's internal storage format |
StorageType |
Determines whether the column is stored in memory or on disk |
Type |
The column's datatype. NDB columns have the datatypes
as found in MySQL |
For a discussion of each of these types, along with its possible
values, see Section 2.3.1.1, “Column
Types”.
Class diagram.
This diagram shows all the available methods and enumerated types
of the Column
class: