On this page you may find all TimeBase annotations and data bindings
Click Tag to Display Pages: technology development
  • Entity - Typically, an Entity represents a schema class descriptor in TimeBase, and each entity instance corresponds to a message. The primary programming artifact of an entity is the entity class, although entities can use helper classes.
  • Persistent Property - the entity must follow the method conventions of JavaBeans components.
  • JavaBeans-Style Properties - use public getter and setter methods that are typically named after the entity class’s instance variable names. For every persistent property of type Type of the entity, there is a getter method getProperty and setter method setProperty. If the property is a Boolean, you may use isProperty instead of getProperty.
  • Persistent Field - non-final public field of the Entity

SchemaElement Annotation

public @interface SchemaElement {
	String name() default "";
	String title() default "";
	String description() default "";
}

Example Java

@SchemaElement(name = "deltix.timebase.api.messages.BarMessage", title = "Bar Message")
public class BarMessage extends MarketMessage implements BarMessageInterface {
  ...
}

@SchemaElement
public boolean isNational() {
return isNational == 1;
}

@SchemaElement(name = "deltix.custom.Status")
public enum Status {
	@SchemaElement(name = "Closed")
	CLOSED,
	@SchemaElement(name = "Open")
	OPEN
}

The SchemaElement annotation is used to specify that a persistent property or field is mapped to the TimeBase schema field. Also SchemaElement is used for mapping Entity (Class or ENUM) to TimeBase Schema Descriptor with specified “name”.

  • name (Optional) - The name mapped schema field. If not specified, field/property name is used.
  • title (Optional) - The title of the schema field. Empty if not specified.
  • description (Optional)- The description of the schema field. Empty if not specified.

Schema Data Types

SchemaDataType ENUM defines the list of supported TimeBase Data Types.

Data Type Description Supported
Encodings
Java Types .NET Types
CHAR The CHAR data type represents a single Unicode character String
CharSequnce
StringBuilder
String
StringBuilder
MutableString
VARCHAR The VARCHAR data type represents a variable size string (text). An empty string is different from the NULL value UTF8
ALPHANUMERIC(N)
String
CharSequnce
StringBuilder
long for ALPHANUMERIC
String
StringBuilder
MutableString
long for ALPHANUMERIC
BOOLEAN The BOOLEAN data type represents a Boolean (logical) value, which is one of TRUE or FALSE int
boolean
int
bool
BINARY The BINARY data type can be used for storing arbitrary raw data. byte[] byte[]
INTEGER The INTEGER data type represents an integer number. The INTEGER type can be constrained by specifying the minimum and maximum values. SIGNED(N), N=8,16,32,48,64
UNSIGNED (M), M=30,61
INTERVAL
byte
short
int
long
byte
short
int
long
FLOAT The FLOAT data type represents a floating-point number. The FLOAT type can be constrained by specifying the minimum and maximum values. BINARY (32)
BINARY (64)
DECIMAL
DECIMAL64
DECIMAL (n)
decimal
double
float
long for DECIMAL64
decimal
double
float
long for DECIMAL64
TIMESTAMP The TIMESTAMP data type represents an absolute, time zone-independent, number of millisecond passed from 1/1/1970 long DateTime
TIME_OF_DAY The TIMEOFDAY data type represents a time of day in millisecond resolution. long
int
DateTime
OBJECT The Object type defines a structure, consisting of a determined sequence of fields. Object Object
ENUM The enumerated type defines its values as a set of named constants. int
short
int
short
DEFAULT Type from field/property will be used.

Default Type Mappings

Java Type .NET Type TimeBase Type
String String VARCHAR
CharSequnce MutableString VARCHAR
StringBuilder StringBuilder VARCHAR
boolean bool BOOLEAN
byte bool? BOOLEAN, [NULLABLE]
byte byte INTEGER, SIGNED(8)
byte byte? INTEGER, SIGNED(8), [NULLABLE]
short short INTEGER, SIGNED(16)
int int INTEGER, SIGNED(32)
int int? INTEGER, SIGNED(64), [NULLABLE]
long long INTEGER, SIGNED(64) , FLOAT DECIMAL64
long long? INTEGER, SIGNED(64) , FLOAT DECIMAL64, [NULLABLE]
float float FLOAT, BINARY (32)
float float? FLOAT, BINARY (32), [NULLABLE]
double double FLOAT
double double? FLOAT, [NULLABLE]
decimal FLOAT
enum enum ENUM
enum enum? ENUM, [NULLABLE]
byte[] byte[] BINARY
Object Object OBJECT

SchemaType Annotation


public @interface SchemaType

	{
    	SchemaDataType dataType() default SchemaDataType.DEFAULT;
		String encoding() default "";
		boolean isNullable() default true;
		String minimum() default "";
		String maximum() default "";
		Class[] nestedTypes() default { };
	}

Example Java 

@SchemaType(encoding = "SIGNED(8)", dataType = SchemaDataType.INTEGER, minimum = "1", maximum = "
12")

public byte getContractMonth() {
return contractMonth;
  }

SchemaType annotation is used to specify TimeBase Type of the field/property.

If no SchemaType annotation is present - then default values apply according to the field/property type.

  • dataType (Optional) - Data Type specification. If omitted, default type will be used.
  • encoding (Optional) - Data Type Encoding.
  • isNullable (Optional) - Nullability specification.
  • minimum (Optional) - Left bound for numeric data types.
  • maximum (Optional) - Right bound for numeric data types.
  • nestedTypes (Optional) - Polymorphic type specification for the OBJECT data types.

SchemaIgnore Annotation

SchemaIgnore annotation is used to specify that field/property is excluded from mapping.

SchemaStaticType Annotation


public @interface SchemaStaticType {
String value()
    SchemaDataType dataType() default SchemaDataType.DEFAULT;
}

SchemaStaticType annotation is used to specify static persistent field/property.

PrimaryKey Annotation

PrimaryKey annotation is used to specify that persistent field/property is part of message primary key.

RelativeTo Annotation


public @interface RelativeTo {
	String value()
}


Example Java 

@RelativeTo("close")
public double getHigh() {
	return high;
}

RelativeTo annotation is used to specify that persistent field/property decoding depends on other field/property value.

Applicable for numeric types only.

  • value (Required) - Name of the TimeBase field.

TimeBase supports so-called relative encoding. Consider a typical financial event, the price bar. The one-minute price bar, for example, contains the open, high, low and close values of the price of a security for every one-minute interval it was active. To optimize performance, it makes sense to store close as a number, and open, high, and low as a delta from close. This approach saves space and increases reading speed. In TimeBase, the relative encoding mode is a generic part of the type system and can be used with any user-defined data structure, not only price bars.

OldElementName Annotation


public @interface OldElementName {
	String value()
}


Example Java 

@SchemaType(encoding = "ALPHANUMERIC(10)", dataType = SchemaDataType.VARCHAR)
@SchemaElement(title = "Exchange Code")
@OldElementName("exchangeCode")
public long getExchangeId() {
	return exchangeId;
}

OldElementName annotation is used to specify backward compatible TimeBase field name for the persistent field/property and entity.

Used for automatic schema migration.

Bitmask Annotation


public @interface Bitmask {
	String value()
}

Bitmask annotation is used to specify that ENUM values should have bitmask numeric codes.

SchemaArrayType Annotation


public @interface SchemaType

	{
		boolean isNullable() default true;
		boolean isElementNullable() default true;
   		SchemaDataType elementDataType() default SchemaDataType.DEFAULT;
		String elementMinimum() default "";
		String elementMaximum() default "";
		lass[] elementTypes() default { };
	}
Example Java 

@SchemaArrayType(elementTypes = {Level2Action.class} )

@SchemaElement
public ObjectArrayList<Level2ActionInfo> getActions()  {
	return actions;
}
@SchemaArrayType(elementDataType = SchemaDataType.TIMESTAMP)
@SchemaElement(title = "Coupon Dates")
public LongArrayList getCouponDates() {
	return couponDates;
}

SchemaArrayType annotation is used to specify TimeBase Array Type of the field/property.

If no SchemaType annotation is present - then default values apply according to the field/property type.

  • isNullable (Optional) - Nullability specification.
  • isElementNullable (Optional) - Nullability specification for the Array elements.
  • elementMinimum (Optional) - Array elements Left bound for numeric data types.
  • elementMaximum (Optional) - Array elements right bound for numeric data types.
  • elementTypes (Optional) - Types specification for the ARRAY of OBJECT data types.

Known restrictions for the field/property mapped to SchemaArrayType:

  • [Java] for primitive types supported collections: BooleanArrayList, CharacterArrayList, ShortArrayList, IntegerArrayList, LongArrayList, DoubleArrayList, FloatArrayList, BinaryArray, ByteArrayList
  • [Java] for object types supported ObjectArrayList and ArratList implementations
  • [.NET] supported any implementation of the List

Supported Array Mappings

Java Type .NET Type TimeBase Type DLL Notation
BinaryArray BinaryArray ARRAY(INTEGER SIGNED (8))
BooleanArrayList IList bool ARRAY(BOOLEAN)
ShortArrayList IList short ARRAY(INTEGER SIGNED(16))
IntegerArrayList IList int ARRAY(INTEGER SIGNED(32))
LongArrayList IList long ARRAY(INTEGER SIGNED(64))
FloatArrayList IList float ARRAY(INTEGER FLOAT BINARY (32))
DoubleArrayList IList double ARRAY(INTEGER FLOAT)
CharacterArrayList IList char ARRAY(VARCHAR)
ObjectArrayList IList Object ARRAY(OBJECT)

NULL Values for Primitive Data Types

Data Type NULL Value
BOOLEAN -1
BYTE Byte.MIN_VALUE
SHORT Short.MIN_VALUE
INTEGER Integer.MIN_VALUE
INT48 -140737488355328L
LONG Long.MIN_VALUE
PINTERVAL 0
FLOAT Float.NaN
DOUBLE Double.NaN
DECIMAL Decimal64Utils.NULL
TIME_OF_DAY -1
DURATION Integer.MIN_VALUE
TIMESTAMP Long.MIN_VALUE
ENUM -1
ALPHANUMERIC Long.MIN_VALUE