JSColumnObject

Overview

The JSColumnObject is a scripting object that represents a data-source column created through JSTableObject.createNewColumn(...). It extends JSColumn by providing additional setter methods for modifying the column's properties, such as nullability, flags, sequence types, and row identifier types. These changes are not immediately applied but take effect only after invoking server.synchronizeWithDB().

This object allows developers to customize columns further during table creation, including defining primary key configurations, database sequences, and UUID generation settings. Flags can also be set or cleared to mark columns as excluded, tenant-specific, or native type columns.

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 flags of columns.

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.

Properties Summarized

Type
Name
Summary

Get or set the allow-null flag of a new column.

Get or set the row identifier type of the column.

Get or set the sequence type of the column.

Methods Summarized

Type
Name
Summary

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 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 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.

void

Set the database sequence name of the column, used for columns with sequence type JSColumn.

void

Set or clear a flag of a new column.

Constants Detailed

DATABASE_IDENTITY

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

Type Number

Sample

DATABASE_SEQUENCE

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

Type Number

Sample

DATETIME

Constant used when setting or getting the type of columns.

Type Number

Sample

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

INTEGER

Constant used when setting or getting the type of columns.

Type Number

Sample

MEDIA

Constant used when setting or getting the type of columns.

Type Number

Sample

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

NONE

Constant for column information indicating unset values.

Type Number

Sample

NO_DATA_LOG_COLUMN

Constant used when setting or getting the flags of columns. This flag indicates columns whose data is not stored in the log table.

Type Number

Sample

NUMBER

Constant used when setting or getting the type of columns.

Type Number

Sample

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

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

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

TEXT

Constant used when setting or getting the type of columns.

Type Number

Sample

UUID_COLUMN

Constant used when setting or getting the flags of columns. This flag identifies columns whose values are treated as UUID.

Type Number

Sample

UUID_GENERATOR

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

Type Number

Sample

Properties Detailed

allowNull

Get or set the allow-null flag of a new column. Note that when a column is added to an existing table, allowNull will always be set. For a primary key column, the allowNull flag will be always off, for other columns the flag is set by default.

Type Boolean

Sample

rowIdentifierType

Get or set the row identifier type of the column. The sequence type is one of: - JSColumn.PK_COLUMN - JSColumn.ROWID_COLUMN - JSColumn.NONE

Type Number

Sample

sequenceType

Get or set the sequence type of the column. The sequence type is one of: - JSColumn.NONE - JSColumn.SERVOY_SEQUENCE - JSColumn.DATABASE_SEQUENCE - JSColumn.DATABASE_IDENTITY - JSColumn.UUID_GENERATOR;

Type Number

Sample

Methods Detailed

getDataProviderID()

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

Returns: String String dataprovider id.

Sample

getDefaultFormat()

Get the default format of the column.

Returns: String String column default format.

Sample

getDescription()

Get the description property of the column.

Returns: String String column description.

Sample

getForeignType()

Get the foreign type of the column. The foreign type can be defined design time as a foreign key reference to another table.

Returns: String String foreign type.

Sample

getLength()

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

Returns: Number int column length.

Sample

getName()

Get the name of the column as used by Servoy.

Returns: String String column name

Sample

getQualifiedName()

Get the qualified name (including table name) of the column as known by the database. The name is quoted, if necessary, as defined by the actual database used.

Returns: String String qualified column name.

Sample

getQuotedSQLName()

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

Returns: String column name, quoted if needed.

Sample

getRawTitle()

Get the raw title property of the column.

Returns: String String column title.

Sample

getSQLName()

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

Returns: String String sql name

Sample

getSQLType()

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

Returns: Number int sql type.

Sample

getScale()

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

Returns: Number int column scale.

Sample

getTable()

Get the JSTable of this column.

Returns: JSTable table The JSTable of this column.

getTitle()

Get the title property of the column. If title is null will return column name.

Returns: String String column title.

Sample

getType()

Get the JDBC type of the column. The type reported by the JDBC driver will be mapped to one of: - JSColumn.DATETIME - JSColumn.TEXT - JSColumn.NUMBER - JSColumn.INTEGER - JSColumn.MEDIA

Returns: Number int sql type.

Sample

getTypeAsString()

Get the name JDBC type of the column. The same mapping as defined in JSColumn.getType() is applied.

Returns: String String sql name.

Sample

hasFlag(flag)

Check a flag of the column. The flags are a bit pattern consisting of 1 or more of the following bits: - JSColumn.UUID_COLUMN - JSColumn.EXCLUDED_COLUMN - JSColumn.TENANT_COLUMN - JSColumn.NATIVE_COLUMN

Parameters

Returns: Boolean boolean whether flag is set.

Sample

setDatabaseSequenceName(sequenceName)

Set the database sequence name of the column, used for columns with sequence type JSColumn.DATABASE_SEQUENCE.

Parameters

  • String sequenceName the sequence name

Returns: void

Sample

setFlag(flag, set)

Set or clear a flag of a new column. The flags are a bit pattern consisting of 1 or more of the following bits: - JSColumn.UUID_COLUMN; - JSColumn.EXCLUDED_COLUMN;

Parameters

  • Number flag the flag to set

  • Boolean set true for set flag, false for clear flag

Returns: void

Sample


Last updated

Was this helpful?