JSColumn

Overview

A scripting object representing a data-source column. It can be reached via root objects

datasources. ...

and

databaseManager. ...

.

Constants Summarized

Type
Name
Summary

Constant used when setting or getting the sequence type of columns.

Constant used when setting or getting the sequence type of columns.

Constant used when setting or getting the type of columns.

Constant used when setting or getting the flags of columns.

Constant used when setting or getting the type of columns.

Constant used when setting or getting the type of columns.

Constant used when setting or getting the flags of columns.

Constant for column information indicating unset values.

Constant used when setting or getting the type of columns.

Constant used when setting or getting the row identifier type of columns.

Constant used when setting or getting the row identifier type of columns.

Constant used when setting or getting the flags of columns.

Constant used when setting or getting the type of columns.

Constant used when setting or getting the flags of columns.

Constant used when setting or getting the sequence type of columns.

Methods Summarized

Type
Name
Summary

Get the allow-null flag of the column.

Get the data provider id for this column (which is the same as name if not explicitly defined otherwise).

Get the default format of the column.

Get the description property of the column.

Get the foreign type of the column.

Get the length of the column as reported by the JDBC driver.

Get the name of the column as used by Servoy.

Get the qualified name (including table name) of the column as known by the database.

Returns a quoted version of the column name, if necessary, as defined by the actual database used.

Get the raw title property of the column.

Get the row identifier type of the column.

Get the name of the column as known by the database.

Get the raw JDBC type of the column, which allows to check database specific types, like sting/byte column type variations.

Get the scale of the column as reported by the JDBC driver.

Get the sequence type of the column.

Get the JSTable of this column.

Get the title property of the column.

Get the JDBC type of the column.

Get the name JDBC type of the column.

Check a flag of the column.

Constants Detailed

DATABASE_IDENTITY

Constant used when setting or getting the sequence type of columns.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid generated column
break;
}

DATABASE_SEQUENCE

Constant used when setting or getting the sequence type of columns.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid generated column
break;
}

DATETIME

Constant used when setting or getting the type of columns.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;
}

EXCLUDED_COLUMN

Constant used when setting or getting the flags of columns. This flag identifies columns that are skipped in the sql.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
if (column.hasFlag(JSColumn.UUID_COLUMN))
{
	// handle uuid column
}

INTEGER

Constant used when setting or getting the type of columns.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;
}

MEDIA

Constant used when setting or getting the type of columns.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;
}

NATIVE_COLUMN

Constant used when setting or getting the flags of columns. This flag identifies columns that are marked as a native type column (for example uniqueidentifier).

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
if (column.hasFlag(JSColumn.UUID_COLUMN))
{
	// handle uuid column
}

NONE

Constant for column information indicating unset values.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid generated column
break;
}

NUMBER

Constant used when setting or getting the type of columns.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;
}

PK_COLUMN

Constant used when setting or getting the row identifier type of columns. This value identifies columns that are defined as primary key in the database.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getRowIdentifierType())
{
case JSColumn.NONE:
	// handle normal column
break;

case JSColumn.PK_COLUMN:
	// handle database pk column
break;

case JSColumn.ROWID_COLUMN:
	// handle developer defined pk column
break;
}

ROWID_COLUMN

Constant used when setting or getting the row identifier type of columns. This value identifies columns that are defined as primary key by the developer (but not in the database).

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getRowIdentifierType())
{
case JSColumn.NONE:
	// handle normal column
break;

case JSColumn.PK_COLUMN:
	// handle database pk column
break;

case JSColumn.ROWID_COLUMN:
	// handle developer defined pk column
break;
}

TENANT_COLUMN

Constant used when setting or getting the flags of columns. This flag identifies columns that are marked as a tenant column.

Type Number

Sample

var table = databaseManager.getTable('db:/example_data/orders')
var column =