OrientDB – Data Types

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

Sr. No.TypeDescription
1BooleanHandles only the values True or False.Java types: java.lang.BooleanMin: 0Max: 1
2Integer32-bit signed integers.Java types: java.lang.IntergerMin: -2,147,483,648Max: +2,147,483,647
3ShortSmall 16-bit signed integers.Java types: java.lang.shortMin: -32,768Max: 32,767
4LongBig 64-bit signed integers.Java types: java.lang.LongMin: -263Max: +263-1
5FloatDecimal numbers.Java types: java.lang.FloatMin: 2-149Max: (2-2-23)*2,127
6DoubleDecimal numbers with high precision.Java types: Java.lang.Double.Min: 2-1074Max: (2-2-52)*21023
7Date-timeAny date with the precision up to milliseconds.Java types: java.util.Date
8StringAny string as alphanumeric sequence of chars.Java types: java.lang.String
9BinaryCan contain any value as byte array.Java types: byte[ ]Min: 0Max: 2,147,483,647
10EmbeddedThe record is contained inside the owner. The contained record has no RecordId.Java types: ORecord
11Embedded listThe 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: 0Max: 41,000,000 items
12Embedded setThe 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: 0Max: 41,000,000 items
13Embedded mapThe 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: 0Max: 41,000,000 items
14LinkLink to another Record. It’s a common one-to-one relationshipJava Types: ORID, <? extends ORecord>Min: 1Max: 32767:2^63-1
15Link listLinks to other Records. It’s a common one-to-many relationship where only the RecordIds are stored.Java types: List<? Extends ORecord>Min: 0Max: 41,000,000 items
16Link setLinks to other records. It’s a common one-to-many relationship.Java types: Set<? extends ORecord>Min: 0Max: 41,000,000 items
17Link mapLinks 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: 0Max: 41,000,000 items
18ByteSingle byte. Useful to store small 8-bit signed integers.Java types: java.lang.ByteMin: -128Max: +127
19TransientAny value not stored on database.
20DateAny date as year, month and day.Java Types: java.util.Date
21CustomUsed to store a custom type providing the Marshall and Unmarshall methods.Java types: OSerializableStreamMin: 0Max: x
22DecimalDecimal numbers without rounding.Java types: java.math.BigDecimal
23LinkBagList of RecordIds as specific RidBag.Java types: ORidBag
24AnyNot 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.

Leave a Reply