Types - aemadrid/orientdb GitHub Wiki

Supported types

Introduction

OrientDB supports several types natively. Below the complete table

). Only the RecordIds are stored)s and are reachable only by navigating the owner Record)s and are reachable only by navigating the owner Record
Type Description Java type **Size in storage (in bytes)** Minimum Maximum **Auto-conversion from/to** JSON format Binary descriptor
String Any string as alphanumeric sequence of chars java.lang.String variable 0-100,000 - - - Test Surrounded with double quotes. Example "Jay"
Byte Single byte. Useful to store small integers with range -128 to +127 java.lang.Byte or byte variable 0-4 -128 +127 Any Number, String 0 Value ends with 'b'. Example: 23b
Short Small integers with range -32,768 to 32,767 java.lang.Short or short variable 0-6 (it's transformed in String) -32,768 32,767 Any Number, String 10000 Value ends with 's'. Example: 23s
Integer Integers with range -2,147,483,648 to +2,147,483,647 java.lang.Integer or int variable 0-11 (it's transformed in String) -2,147,483,648 +2,147,483,647 Any Number, String 1000000 Just the value. Example: 234392
Long Big integers with range -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 java.lang.Long or long variable 0-20 (it's transformed in String) -9,223,372,036,854,775,808 +9,223,372,036,854,775,807 Any Number, String 1000000000 Value ends with 'l'. Example: 23439223l
Float Decimal numbers java.lang.Float or float variable 0-? (it's transformed in String) 1.4e-45f 3.4028235e+38f Any Number, String 100000.33333 Value ends with 'f'. Example: 234392.23f
Decimal Decimal numbers without rounding as for FLOAT and DOUBLE types. Perfect to handle money values java.math.BigDecimal variable 0-? (it's transformed in String) 4.9e-324 1.7976931348623157e+308 Any Number, String 100000000000.33333333 Value ends with 'c'. Example: 2343.9223c
Double Decimal numbers with high precision java.lang.Double or double variable 0-? (it's transformed in String) 4.9e-324 1.7976931348623157e+308 Any Number, String 10000000000.33333333 Value ends with 'd'. Example: 1002020.2302d
Boolean Handles only the values *True* or *False* java.lang.Boolean or boolean 1 0 1 String true 'true' or 'false'. Example: true
Date Any date as year, month and day java.util.Date variable - - Date, Long, String 1002020303 Value in milliseconds ends with 'a'. Example: 1002020303a
Datetime Any date with the precision up to milliseconds java.util.Date variable - 1002020303 Date, Long, String 1002020303 Value in milliseconds ends with 't'. Example: 1002020303t
Binary Can contain any value as byte array {{{byte[surrounded with "`_`". Example: `_`2332322`_`
Link Link to another Record. It's a common [[]}}} variable 0 2,147,483,647 String Value|Concepts#onetooneonetoonerelationship]]. Only the RecordId is stored ORecord<?> instance 0-24 variable (it's transformed in String) -1:-1 32767:9223372036854775807 String #10:3 Just the [RID](Concepts_RID). Example: #10:232
Link list Links to other Records. It's a common One-to-Many relationship. Only the RecordIds are stored List<? extends ORecord<?>> variable 0 41,000,000 items Collection extends ORecord>>, String [#10:4](#10:3,) Collections values separated by commas and surrounded by brackets "[ ]". Example: [
Link set Links to other Records. It's a common [Concepts#One-to-Many One-to-Many relationship](#10:3,#10:6]
Set<? extends ORecord<?>> variable 0 41,000,000 items Collection extends ORecord>>, String Collections values separated by commas and surrounded by brackets "[ ]". Example: [#10:4](#10:3,#10:6] [#10:3,)
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 Map<String, ? extends ORecord<?>> variable 0 41,000,000 items String { 'name' : '#10:3' } Map entries separated by commas and surrounded by curly braces "{ }". Example: {'Jay':#10:3,'Mike':#10:6}
Embedded The Record is contained inside the owner. The contained Record has no RecordId ORecord<?> instance variable (it's transformed in String) - - ORecord> {"Jay":"#10:3","Mike":"#10:6"} Embedded document serialized surrounded by parenthesis "( )". Example: ({'Jay':#10:3,'Mike':#10:6})
Embedded list The Records are contained inside the owner. The contained Records have no RecordIds and are reachable only by navigating the owner Record List<Object> variable 0 41,000,000 items String [20, 30](10,) Collections values separated by commas and surrounded by brackets "[ ]". Example: [
Embedded set The Records are contained inside the owner. The contained Records have no [Concepts#RecordID RecordId](36,20]
Set<Object> variable 0 41,000,000 items Collection extends ORecord>>, String ['is', 'a', 'test']('this',) Collections values separated by commas and surrounded by brackets "[ ]". Example: [
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 [Concepts#RecordID RecordId](36,20]
Map<String, ?> variable 0 41,000,000 items Collection extends ORecord>>, String { 'name' : 'Luca' } Collections values separated by commas and surrounded by curly braces "{ }". Example: {'key1':23,'key2':2332}
Custom used to store a custom type providing the marshall and unmarshall methods OSerializableStream variable 0 X - base64 encoded binary -
⚠️ **GitHub.com Fallback** ⚠️