NexJ Logo

Attributes and data types

When defining class attributes in NexJ Studio, you must specify a data type.

Data types

The following data types are available to attributes of classes. Valid values for each data types are:
any
Any type of data.

binary
Binary data of arbitrary length.

boolean
Either true or false. Boolean values are typically the result of logical expressions. For example, the expression 5 < 10 returns the Boolean value #t, and the expression 5 > 10 returns the Boolean value #f.

currency
Numeric values that represent a monetary value. Currency data types are persisted as decimals.

date
Values that represent a calendar date. Date values cannot include a specific time value and persist at 0 hour UTC.

decimal
Numeric values that contain decimal fractions.

double
Values that represent a double-precision 64-bit floating-point number. Doubles can be used to store numbers that are too small or large to be stored in a float.

float
Values that represent a single-precision 32-bit floating-point number. They can be either whole numbers or numbers that contain a fractional component. For example, the values 2.0 and 2.1 are both floats.

integer
Whole numbers that do not include a decimal place. For example, the value 2 is an integer, while 2.0 is not.

long
Values that represent a 64-bit integer. Longs can be used to store numeric values that are too large to be stored in an integer data type.

percentage
Values that represent a percentage. Percentage data types values are persisted as doubles. In the user interface, percentage data type values are formatted as percent when a field or label is bound to the attribute.

string
Sequences of characters that represent text. String values are surrounded by double quotation marks. For example, the value "Hello World!" is a string.

Strings may contain letters, numbers, and symbols. The symbols " and \ are special characters that cannot be written directly in a string. If you want to write a double quotation mark in a string, use the token \". If you want to write a backslash in a string, use the token \\.

timestamp
Values that represent a specific date and time. Timestamp values differ from date values in that they include a time component and can be mapped to time zones other than UTC.