Attribute

Syntax

An attribute definition is composed of the following elements :

  • name

  • ":" (separator)

  • type (attribute "neutral type" )

  • further information (optional) defined between "{" and "}"

    • annotations (optional)

    • tags (optional)

  • ";" (end of definition)

Syntax :

name : type { annotations and tags } ;

An attribute or link definition can span multiple lines. Example :

name : type { 
            annotations 
            tags } ;

Name

The name can be composed of : letters, numbers and "_" (underscore). Other characters are not allowed. By convention the name usually starts with a lower case character.

Each name must be unique in the entity.

Attribute type

An attribute is a simple and unitary piece of data such as a string, a number, etc.

Its type is defined by a "neutral type" independent of any programming language.

Each "neutral type" will be converted into the target language type during generation.

Telosys offers automatic conversion for most used languages (Java, C#, etc, see Target languages).

Available types

String or text type

string

standard "string" type

Numeric types

byte

8-bit integer range: -128 to +127

short

16-bit integer range: -32,768 to +32,767

int

32-bit integer range: -2,147,483,648 to +2,147,483,647

long

64-bit integer range: -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807

float

single-precision 32-bit IEEE 754 floating point

double

double-precision 64-bit IEEE 754 floating point

decimal

arbitrary precision decimal number, not limited to 32 or 64 bits like float or double

Temporal types

date

to store a date year, month and day

time

to store a time hour, minute, second, and optionally nanosecond without time zone

datetime (since ver 4.3.0)

to store a date with the time year, month, day, hour, minute, second, and optionally nanosecond without time zone

datetimetz (since ver 4.3.0)

same as "datetime" but with "Time Zone Offset"

timetz (since ver 4.3.0)

same as "time" but with "Time Zone Offset"

timestamp

synonym for "datetime", deprecated since ver 4.3.0

Other types

boolean

to store "true"/"false" value

uuid (since ver 4.3.0)

"Universally Unique Identifier" (128-bit number used to uniquely identify information)

binary

to store a sequence of bytes

Last updated