OrientDB - Data Types



OrientDB supports several data types natively. Following is the complete table on the same.

Sr. No.TypeDescription
1 Boolean

Handles only the values True or False.

Java types: java.lang.Boolean

Min: 0

Max: 1

2 Integer

32-bit signed integers.

Java types: java.lang.Interger

Min: -2,147,483,648

Max: +2,147,483,647

3 Short

Small 16-bit signed integers.

Java types: java.lang.short

Min: -32,768

Max: 32,767

4 Long

Big 64-bit signed integers.

Java types: java.lang.Long

Min: -263

Max: +263-1

5 Float

Decimal numbers.

Java types: java.lang.Float

Min: 2-149

Max: (2-2-23)*2,127

6 Double

Decimal numbers with high precision.

Java types: Java.lang.Double.

Min: 2-1074

Max: (2-2-52)*21023

7 Date-time

Any date with the precision up to milliseconds.

Java types: java.util.Date

8 String

Any string as alphanumeric sequence of chars.

Java types: java.lang.String

9 Binary

Can contain any value as byte array.

Java types: byte[ ]

Min: 0

Max: 2,147,483,647

10 Embedded

The record is contained inside the owner. The contained record has no RecordId.

Java types: ORecord

11 Embedded list

The records are contained inside the owner. The contained records have no RecordIds and are reachable only by navigating the owner record.

Java types: List<objects>

Min: 0

Max: 41,000,000 items

12 Embedded set

The records are contained inside the owner. The contained records have no RecordId and are reachable only by navigating the owner record.

Java types: set<objects>

Min: 0

Max: 41,000,000 items

13 Embedded map

The records are contained inside the owner as values of the entries, while the keys can only be strings. The contained records have no RecordId and are reachable only by navigating the owner Record.

Java types: Map<String, ORecord>

Min: 0

Max: 41,000,000 items

14 Link

Link to another Record. It's a common one-to-one relationship

Java Types: ORID, <? extends ORecord>

Min: 1

Max: 32767:2^63-1

15 Link list

Links to other Records. It's a common one-to-many relationship where only the RecordIds are stored.

Java types: List<? Extends ORecord>

Min: 0

Max: 41,000,000 items

16 Link set

Links to other records. It's a common one-to-many relationship.

Java types: Set<? extends ORecord>

Min: 0

Max: 41,000,000 items

17 Link map

Links to other records as value of the entries, while keys can only be strings. It's a common one-to-many relationship. Only the RecordIds are stored.

Java types: Map<String, ? extends Record>

Min: 0

Max: 41,000,000 items

18 Byte

Single byte. Useful to store small 8-bit signed integers.

Java types: java.lang.Byte

Min: -128

Max: +127

19 Transient Any value not stored on database.
20 Date

Any date as year, month and day.

Java Types: java.util.Date

21 Custom

Used to store a custom type providing the Marshall and Unmarshall methods.

Java types: OSerializableStream

Min: 0

Max: x

22 Decimal

Decimal numbers without rounding.

Java types: java.math.BigDecimal

23 LinkBag

List of RecordIds as specific RidBag.

Java types: ORidBag

24 Any

Not determinate type, used to specify collections of mixed type, and null.

In the following chapters, how to use these data types in OrientDB is discussed.

Advertisements