@@ -31,6 +31,12 @@ public enum ExternalPropertyType {
31
31
*/
32
32
INT_128 ,
33
33
/**
34
+ * A UUID (Universally Unique Identifier) as defined by RFC 9562.
35
+ * <p>
36
+ * ObjectBox uses the UUIDv7 scheme (timestamp + random) to create new UUIDs. UUIDv7 is a good choice for database
37
+ * keys as it's mostly sequential and encodes a timestamp. However, if keys are used externally, consider
38
+ * {@link #UUID_V4} for better privacy by not exposing any time information.
39
+ * <p>
34
40
* Representing type: ByteVector
35
41
* <p>
36
42
* Encoding: 1:1 binary representation (16 bytes)
@@ -44,6 +50,32 @@ public enum ExternalPropertyType {
44
50
* Encoding: 1:1 binary representation (16 bytes)
45
51
*/
46
52
DECIMAL_128 ,
53
+ /**
54
+ * UUID represented as a string of 36 characters, e.g. "019571b4-80e3-7516-a5c1-5f1053d23fff".
55
+ * <p>
56
+ * For efficient storage, consider the {@link #UUID} type instead, which occupies only 16 bytes (20 bytes less).
57
+ * This type may still be a convenient alternative as the string type is widely supported and more human-readable.
58
+ * In accordance to standards, new UUIDs generated by ObjectBox use lowercase hexadecimal digits.
59
+ * <p>
60
+ * Representing type: String
61
+ */
62
+ UUID_STRING ,
63
+ /**
64
+ * A UUID (Universally Unique Identifier) as defined by RFC 9562.
65
+ * <p>
66
+ * ObjectBox uses the UUIDv4 scheme (completely random) to create new UUIDs.
67
+ * <p>
68
+ * Representing type: ByteVector
69
+ * <p>
70
+ * Encoding: 1:1 binary representation (16 bytes)
71
+ */
72
+ UUID_V4 ,
73
+ /**
74
+ * Like {@link #UUID_STRING}, but using the UUIDv4 scheme (completely random) to create new UUID.
75
+ * <p>
76
+ * Representing type: String
77
+ */
78
+ UUID_V4_STRING ,
47
79
/**
48
80
* A key/value map; e.g. corresponds to a JSON object or a MongoDB document (although not keeping the key order).
49
81
* Unlike the Flex type, this must contain a map value (e.g. not a vector or a scalar).
0 commit comments