Skip to content

Commit 4259c67

Browse files
More external types: re-generate ExternalPropertyType #260
1 parent 2e91a1f commit 4259c67

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

objectbox-java/src/main/java/io/objectbox/model/ExternalPropertyType.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ private ExternalPropertyType() { }
3737
public static final short Int128 = 100;
3838
public static final short Reserved1 = 101;
3939
/**
40+
* A UUID (Universally Unique Identifier) as defined by RFC 9562.
41+
* ObjectBox uses the UUIDv7 scheme (timestamp + random) to create new UUIDs.
42+
* UUIDv7 is a good choice for database keys as it's mostly sequential and encodes a timestamp.
43+
* However, if keys are used externally, consider UuidV4 for better privacy by not exposing any time information.
4044
* Representing type: ByteVector
4145
* Encoding: 1:1 binary representation (16 bytes)
4246
*/
@@ -47,9 +51,26 @@ private ExternalPropertyType() { }
4751
* Encoding: 1:1 binary representation (16 bytes)
4852
*/
4953
public static final short Decimal128 = 103;
50-
public static final short Reserved2 = 104;
51-
public static final short Reserved3 = 105;
52-
public static final short Reserved4 = 106;
54+
/**
55+
* UUID represented as a string of 36 characters, e.g. "019571b4-80e3-7516-a5c1-5f1053d23fff".
56+
* For efficient storage, consider the 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+
* Representing type: String
60+
*/
61+
public static final short UuidString = 104;
62+
/**
63+
* A UUID (Universally Unique Identifier) as defined by RFC 9562.
64+
* ObjectBox uses the UUIDv4 scheme (completely random) to create new UUIDs.
65+
* Representing type: ByteVector
66+
* Encoding: 1:1 binary representation (16 bytes)
67+
*/
68+
public static final short UuidV4 = 105;
69+
/**
70+
* Like UuidString, but using the UUIDv4 scheme (completely random) to create new UUID.
71+
* Representing type: String
72+
*/
73+
public static final short UuidV4String = 106;
5374
/**
5475
* A key/value map; e.g. corresponds to a JSON object or a MongoDB document (although not keeping the key order).
5576
* Unlike the Flex type, this must contain a map value (e.g. not a vector or a scalar).
@@ -123,7 +144,7 @@ private ExternalPropertyType() { }
123144
*/
124145
public static final short MongoRegex = 127;
125146

126-
public static final String[] names = { "Unknown", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Int128", "Reserved1", "Uuid", "Decimal128", "Reserved2", "Reserved3", "Reserved4", "FlexMap", "FlexVector", "Json", "Bson", "JavaScript", "Reserved5", "Reserved6", "Reserved7", "Reserved8", "Int128Vector", "Reserved9", "UuidVector", "Reserved10", "Reserved11", "Reserved12", "Reserved13", "MongoId", "MongoIdVector", "MongoTimestamp", "MongoBinary", "MongoRegex", };
147+
public static final String[] names = { "Unknown", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Int128", "Reserved1", "Uuid", "Decimal128", "UuidString", "UuidV4", "UuidV4String", "FlexMap", "FlexVector", "Json", "Bson", "JavaScript", "Reserved5", "Reserved6", "Reserved7", "Reserved8", "Int128Vector", "Reserved9", "UuidVector", "Reserved10", "Reserved11", "Reserved12", "Reserved13", "MongoId", "MongoIdVector", "MongoTimestamp", "MongoBinary", "MongoRegex", };
127148

128149
public static String name(int e) { return names[e]; }
129150
}

0 commit comments

Comments
 (0)