Supported Data Types
OrientDB supports several data types natively. Below is the complete table.
#id | Type | SQL type | Description | Java type | Minimum Maximum | Auto-conversion from/to |
---|---|---|---|---|---|---|
0 | Boolean | BOOLEAN | Handles only the values True or False | java.lang.Boolean or boolean | 0 1 | String |
1 | Integer | INTEGER | 32-bit signed Integers | java.lang.Integer or int | -2,147,483,648 +2,147,483,647 | Any Number, String |
2 | Short | SHORT | Small 16-bit signed integers | java.lang.Short or short | -32,768 32,767 | Any Number, String |
3 | Long | LONG | Big 64-bit signed integers | java.lang.Long or long | -263 +263-1 | Any Number, String |
4 | Float | FLOAT | Decimal numbers | java.lang.Float or float | 2-149 (2-2-23)*2127 | Any Number, String |
5 | Double | DOUBLE | Decimal numbers with high precision | java.lang.Double or double | 2-1074 (2-2-52)*21023 | Any Number, String |
6 | Datetime | DATETIME | Any date with the precision up to milliseconds. To know more about it, look at Managing Dates | java.util.Date | - 1002020303 | Date, Long, String |
7 | String | STRING | Any string as alphanumeric sequence of chars | java.lang.String | - - | - |
8 | Binary | BINARY | Can contain any value as byte array | byte[] | 0 2,147,483,647 | String |
9 | Embedded | EMBEDDED | The Record is contained inside the owner. The contained Record has no Record ID | ORecord | - - | ORecord |
10 | Embedded list | EMBEDDEDLIST | The Records are contained inside the owner. The contained records have no Record ID's and are reachable only by navigating the owner record | List<Object> | 0 41,000,000 items | String |
11 | Embedded set | EMBEDDEDSET | The Records are contained inside the owner. The contained Records have no Record ID and are reachable only by navigating the owner record | Set<Object> | 0 41,000,000 items | String |
12 | Embedded map | EMBEDDEDMAP | The Records are contained inside the owner as values of the entries, while the keys can only be Strings. The contained ords e no Record IDs and are reachable only by navigating the owner Record | Map<String, ORecord> | 0 41,000,000 items | Collection<? extends ORecord<?>> , String |
13 | Link | LINK | Link to another Record. It's a common one-to-one relationship | ORID , <? extends ORecord> | 1:-1 32767:2^63-1 | String |
14 | Link list | LINKLIST | Links to other Records. It's a common one-to-many relationship where only the Record IDs are stored | List<? extends ORecord | 0 41,000,000 items | String |
15 | Link set | LINKSET | Links to other Records. It's a common one-to-many relationship | Set<? extends ORecord> | 0 41,000,000 items | Collection<? extends ORecord> , String |
16 | Link map | LINKMAP | 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 Record IDs are stored | Map<String, | 0 41,000,000 items | String |
17 | Byte | BYTE | Single byte. Useful to store small 8-bit signed integers | java.lang.Byte or byte | -128 +127 | Any Number, String |
18 | Transient | TRANSIENT | Any value not stored on database | |||
19 | Date | DATE | Any date as year, month and day. To know more about it, look at Managing Dates | java.util.Date | - | Date, Long, String |
20 | Custom | CUSTOM | used to store a custom type providing the marshall and unmarshall methods | OSerializableStream | 0 X | - |
21 | Decimal | DECIMAL | Decimal numbers without rounding | java.math.BigDecimal | ? ? | Any Number, String |
22 | LinkBag | LINKBAG | List of Record IDs as spec RidBag | ORidBag | ? ? | - |
23 | Any | ANY | Not determinated type, used to specify Collections of mixed type, and null | - | - | - |