OrientDB supports several data types natively. Following is the complete table on the same.
Sr. No. | Type | Description |
---|---|---|
1 | Boolean | Handles only the values True or False.Java types: java.lang.BooleanMin: 0Max: 1 |
2 | Integer | 32-bit signed integers.Java types: java.lang.IntergerMin: -2,147,483,648Max: +2,147,483,647 |
3 | Short | Small 16-bit signed integers.Java types: java.lang.shortMin: -32,768Max: 32,767 |
4 | Long | Big 64-bit signed integers.Java types: java.lang.LongMin: -263Max: +263-1 |
5 | Float | Decimal numbers.Java types: java.lang.FloatMin: 2-149Max: (2-2-23)*2,127 |
6 | Double | Decimal numbers with high precision.Java types: Java.lang.Double.Min: 2-1074Max: (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: 0Max: 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: 0Max: 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: 0Max: 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: 0Max: 41,000,000 items |
14 | Link | Link to another Record. It’s a common one-to-one relationshipJava Types: ORID, <? extends ORecord>Min: 1Max: 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: 0Max: 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: 0Max: 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: 0Max: 41,000,000 items |
18 | Byte | Single byte. Useful to store small 8-bit signed integers.Java types: java.lang.ByteMin: -128Max: +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: OSerializableStreamMin: 0Max: 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.