GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Flatbuffers: update to 23.5.26, schema with new validation options. · jamestiotio/objectbox-java@c257f1f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • objectbox-java/src/main/java/io/objectbox
    • BoxStoreBuilder.java
    • DebugFlags.java
    • flatbuffers
      • Constants.java
      • FlexBuffersBuilder.java
      • README.md
    • model
      • EntityFlags.java
      • FlatStoreOptions.java
      • IdUid.java
      • Model.java
      • ModelEntity.java
      • ModelProperty.java
      • ModelRelation.java
      • PropertyFlags.java
      • PropertyType.java
      • SyncFlags.java
      • TreeOptionFlags.java
      • ValidateOnOpenMode.java
      • ValidateOnOpenModeKv.java
    • query
      • OrderFlags.java
  • scripts
    • update-flatbuffers.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎objectbox-java/src/main/java/io/objectbox/BoxStoreBuilder.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/BoxStoreBuilder.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ byte[] buildFlatStoreOptions(String canonicalPath) {
520520
FlatStoreOptions.addFileMode(fbb, fileMode);
521521
FlatStoreOptions.addMaxReaders(fbb, maxReaders);
522522
if (validateOnOpenMode != 0) {
523-
FlatStoreOptions.addValidateOnOpen(fbb, validateOnOpenMode);
523+
FlatStoreOptions.addValidateOnOpenPages(fbb, validateOnOpenMode);
524524
if (validateOnOpenPageLimit != 0) {
525525
FlatStoreOptions.addValidateOnOpenPageLimit(fbb, validateOnOpenPageLimit);
526526
}
Collapse file

‎objectbox-java/src/main/java/io/objectbox/DebugFlags.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/DebugFlags.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2023 ObjectBox Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
Collapse file

‎objectbox-java/src/main/java/io/objectbox/flatbuffers/Constants.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/flatbuffers/Constants.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class Constants {
4646
Changes to the Java implementation need to be sure to change
4747
the version here and in the code generator on every possible
4848
incompatible change */
49-
public static void FLATBUFFERS_2_0_8() {}
49+
public static void FLATBUFFERS_23_5_26() {}
5050
}
5151

5252
/// @endcond
Collapse file

‎objectbox-java/src/main/java/io/objectbox/flatbuffers/FlexBuffersBuilder.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/flatbuffers/FlexBuffersBuilder.java
+22-1Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,21 @@ public ReadWriteBuf getBuffer() {
173173
return bb;
174174
}
175175

176+
/**
177+
* Insert a null value into the buffer
178+
*/
179+
public void putNull() {
180+
putNull(null);
181+
}
182+
183+
/**
184+
* Insert a null value into the buffer
185+
* @param key key used to store element in map
186+
*/
187+
public void putNull(String key) {
188+
stack.add(Value.nullValue(putKey(key)));
189+
}
190+
176191
/**
177192
* Insert a single boolean into the buffer
178193
* @param val true or false
@@ -502,7 +517,9 @@ public ByteBuffer finish() {
502517
* @return Value representing the created vector
503518
*/
504519
private Value createVector(int key, int start, int length, boolean typed, boolean fixed, Value keys) {
505-
assert (!fixed || typed); // typed=false, fixed=true combination is not supported.
520+
if (fixed & !typed)
521+
throw new UnsupportedOperationException("Untyped fixed vector is not supported");
522+
506523
// Figure out smallest bit width we can store this vector with.
507524
int bitWidth = Math.max(WIDTH_8, widthUInBits(length));
508525
int prefixElems = 1;
@@ -673,6 +690,10 @@ private static class Value {
673690
this.iValue = Long.MIN_VALUE;
674691
}
675692

693+
static Value nullValue(int key) {
694+
return new Value(key, FBT_NULL, WIDTH_8, 0);
695+
}
696+
676697
static Value bool(int key, boolean b) {
677698
return new Value(key, FBT_BOOL, WIDTH_8, b ? 1 : 0);
678699
}
Collapse file

‎objectbox-java/src/main/java/io/objectbox/flatbuffers/README.md‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/flatbuffers/README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This is a copy of the [FlatBuffers](https://github.com/google/flatbuffers) for Java source code in a custom package
44
to avoid conflicts with FlatBuffers generated Java code from users of this library.
55

6-
Current version: `2.0.8` (Note: version in `Constants.java` may be lower).
6+
Current version: `23.5.26` (Note: version in `Constants.java` may be lower).
77

88
Copy a different version using the script in `scripts\update-flatbuffers.sh`.
99
It expects FlatBuffers source files in the `../flatbuffers` directory (e.g. check out
Collapse file

‎objectbox-java/src/main/java/io/objectbox/model/EntityFlags.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/model/EntityFlags.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2023 ObjectBox Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
Collapse file

‎objectbox-java/src/main/java/io/objectbox/model/FlatStoreOptions.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/model/FlatStoreOptions.java
+33-13Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2023 ObjectBox Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,10 +18,22 @@
1818

1919
package io.objectbox.model;
2020

21-
import java.nio.*;
22-
import java.lang.*;
23-
import java.util.*;
24-
import io.objectbox.flatbuffers.*;
21+
import io.objectbox.flatbuffers.BaseVector;
22+
import io.objectbox.flatbuffers.BooleanVector;
23+
import io.objectbox.flatbuffers.ByteVector;
24+
import io.objectbox.flatbuffers.Constants;
25+
import io.objectbox.flatbuffers.DoubleVector;
26+
import io.objectbox.flatbuffers.FlatBufferBuilder;
27+
import io.objectbox.flatbuffers.FloatVector;
28+
import io.objectbox.flatbuffers.IntVector;
29+
import io.objectbox.flatbuffers.LongVector;
30+
import io.objectbox.flatbuffers.ShortVector;
31+
import io.objectbox.flatbuffers.StringVector;
32+
import io.objectbox.flatbuffers.Struct;
33+
import io.objectbox.flatbuffers.Table;
34+
import io.objectbox.flatbuffers.UnionVector;
35+
import java.nio.ByteBuffer;
36+
import java.nio.ByteOrder;
2537

2638
/**
2739
* Options to open a store with. Set only the values you want; defaults are used otherwise.
@@ -31,7 +43,7 @@
3143
*/
3244
@SuppressWarnings("unused")
3345
public final class FlatStoreOptions extends Table {
34-
public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_8(); }
46+
public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); }
3547
public static FlatStoreOptions getRootAsFlatStoreOptions(ByteBuffer _bb) { return getRootAsFlatStoreOptions(_bb, new FlatStoreOptions()); }
3648
public static FlatStoreOptions getRootAsFlatStoreOptions(ByteBuffer _bb, FlatStoreOptions obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
3749
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
@@ -85,7 +97,7 @@ public final class FlatStoreOptions extends Table {
8597
* OSes, file systems, or hardware.
8698
* Note: ObjectBox builds upon ACID storage, which already has strong consistency mechanisms in place.
8799
*/
88-
public int validateOnOpen() { int o = __offset(14); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
100+
public int validateOnOpenPages() { int o = __offset(14); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
89101
/**
90102
* To fine-tune database validation, you can specify a limit on how much data is looked at.
91103
* This is measured in "pages" with a page typically holding 4K.
@@ -143,14 +155,19 @@ public final class FlatStoreOptions extends Table {
143155
* Max data and DB sizes can be combined; data size must be below the DB size.
144156
*/
145157
public long maxDataSizeInKbyte() { int o = __offset(32); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
158+
/**
159+
* When a database is opened, ObjectBox can perform additional consistency checks on its database structure.
160+
* This enum is used to enable validation checks on a key/value level.
161+
*/
162+
public int validateOnOpenKv() { int o = __offset(34); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
146163

147164
public static int createFlatStoreOptions(FlatBufferBuilder builder,
148165
int directoryPathOffset,
149166
int modelBytesOffset,
150167
long maxDbSizeInKbyte,
151168
long fileMode,
152169
long maxReaders,
153-
int validateOnOpen,
170+
int validateOnOpenPages,
154171
long validateOnOpenPageLimit,
155172
int putPaddingMode,
156173
boolean skipReadSchema,
@@ -159,8 +176,9 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
159176
boolean readOnly,
160177
long debugFlags,
161178
boolean noReaderThreadLocals,
162-
long maxDataSizeInKbyte) {
163-
builder.startTable(15);
179+
long maxDataSizeInKbyte,
180+
int validateOnOpenKv) {
181+
builder.startTable(16);
164182
FlatStoreOptions.addMaxDataSizeInKbyte(builder, maxDataSizeInKbyte);
165183
FlatStoreOptions.addValidateOnOpenPageLimit(builder, validateOnOpenPageLimit);
166184
FlatStoreOptions.addMaxDbSizeInKbyte(builder, maxDbSizeInKbyte);
@@ -169,8 +187,9 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
169187
FlatStoreOptions.addFileMode(builder, fileMode);
170188
FlatStoreOptions.addModelBytes(builder, modelBytesOffset);
171189
FlatStoreOptions.addDirectoryPath(builder, directoryPathOffset);
190+
FlatStoreOptions.addValidateOnOpenKv(builder, validateOnOpenKv);
172191
FlatStoreOptions.addPutPaddingMode(builder, putPaddingMode);
173-
FlatStoreOptions.addValidateOnOpen(builder, validateOnOpen);
192+
FlatStoreOptions.addValidateOnOpenPages(builder, validateOnOpenPages);
174193
FlatStoreOptions.addNoReaderThreadLocals(builder, noReaderThreadLocals);
175194
FlatStoreOptions.addReadOnly(builder, readOnly);
176195
FlatStoreOptions.addUsePreviousCommitOnValidationFailure(builder, usePreviousCommitOnValidationFailure);
@@ -179,7 +198,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
179198
return FlatStoreOptions.endFlatStoreOptions(builder);
180199
}
181200

182-
public static void startFlatStoreOptions(FlatBufferBuilder builder) { builder.startTable(15); }
201+
public static void startFlatStoreOptions(FlatBufferBuilder builder) { builder.startTable(16); }
183202
public static void addDirectoryPath(FlatBufferBuilder builder, int directoryPathOffset) { builder.addOffset(0, directoryPathOffset, 0); }
184203
public static void addModelBytes(FlatBufferBuilder builder, int modelBytesOffset) { builder.addOffset(1, modelBytesOffset, 0); }
185204
public static int createModelBytesVector(FlatBufferBuilder builder, byte[] data) { return builder.createByteVector(data); }
@@ -188,7 +207,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
188207
public static void addMaxDbSizeInKbyte(FlatBufferBuilder builder, long maxDbSizeInKbyte) { builder.addLong(2, maxDbSizeInKbyte, 0L); }
189208
public static void addFileMode(FlatBufferBuilder builder, long fileMode) { builder.addInt(3, (int) fileMode, (int) 0L); }
190209
public static void addMaxReaders(FlatBufferBuilder builder, long maxReaders) { builder.addInt(4, (int) maxReaders, (int) 0L); }
191-
public static void addValidateOnOpen(FlatBufferBuilder builder, int validateOnOpen) { builder.addShort(5, (short) validateOnOpen, (short) 0); }
210+
public static void addValidateOnOpenPages(FlatBufferBuilder builder, int validateOnOpenPages) { builder.addShort(5, (short) validateOnOpenPages, (short) 0); }
192211
public static void addValidateOnOpenPageLimit(FlatBufferBuilder builder, long validateOnOpenPageLimit) { builder.addLong(6, validateOnOpenPageLimit, 0L); }
193212
public static void addPutPaddingMode(FlatBufferBuilder builder, int putPaddingMode) { builder.addShort(7, (short) putPaddingMode, (short) 0); }
194213
public static void addSkipReadSchema(FlatBufferBuilder builder, boolean skipReadSchema) { builder.addBoolean(8, skipReadSchema, false); }
@@ -198,6 +217,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
198217
public static void addDebugFlags(FlatBufferBuilder builder, long debugFlags) { builder.addInt(12, (int) debugFlags, (int) 0L); }
199218
public static void addNoReaderThreadLocals(FlatBufferBuilder builder, boolean noReaderThreadLocals) { builder.addBoolean(13, noReaderThreadLocals, false); }
200219
public static void addMaxDataSizeInKbyte(FlatBufferBuilder builder, long maxDataSizeInKbyte) { builder.addLong(14, maxDataSizeInKbyte, 0L); }
220+
public static void addValidateOnOpenKv(FlatBufferBuilder builder, int validateOnOpenKv) { builder.addShort(15, (short) validateOnOpenKv, (short) 0); }
201221
public static int endFlatStoreOptions(FlatBufferBuilder builder) {
202222
int o = builder.endTable();
203223
return o;
Collapse file

‎objectbox-java/src/main/java/io/objectbox/model/IdUid.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/model/IdUid.java
+17-5Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2023 ObjectBox Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,10 +18,22 @@
1818

1919
package io.objectbox.model;
2020

21-
import java.nio.*;
22-
import java.lang.*;
23-
import java.util.*;
24-
import io.objectbox.flatbuffers.*;
21+
import io.objectbox.flatbuffers.BaseVector;
22+
import io.objectbox.flatbuffers.BooleanVector;
23+
import io.objectbox.flatbuffers.ByteVector;
24+
import io.objectbox.flatbuffers.Constants;
25+
import io.objectbox.flatbuffers.DoubleVector;
26+
import io.objectbox.flatbuffers.FlatBufferBuilder;
27+
import io.objectbox.flatbuffers.FloatVector;
28+
import io.objectbox.flatbuffers.IntVector;
29+
import io.objectbox.flatbuffers.LongVector;
30+
import io.objectbox.flatbuffers.ShortVector;
31+
import io.objectbox.flatbuffers.StringVector;
32+
import io.objectbox.flatbuffers.Struct;
33+
import io.objectbox.flatbuffers.Table;
34+
import io.objectbox.flatbuffers.UnionVector;
35+
import java.nio.ByteBuffer;
36+
import java.nio.ByteOrder;
2537

2638
/**
2739
* ID tuple: besides the main ID there is also a UID for verification
Collapse file

‎objectbox-java/src/main/java/io/objectbox/model/Model.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/model/Model.java
+18-6Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2023 ObjectBox Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,10 +18,22 @@
1818

1919
package io.objectbox.model;
2020

21-
import java.nio.*;
22-
import java.lang.*;
23-
import java.util.*;
24-
import io.objectbox.flatbuffers.*;
21+
import io.objectbox.flatbuffers.BaseVector;
22+
import io.objectbox.flatbuffers.BooleanVector;
23+
import io.objectbox.flatbuffers.ByteVector;
24+
import io.objectbox.flatbuffers.Constants;
25+
import io.objectbox.flatbuffers.DoubleVector;
26+
import io.objectbox.flatbuffers.FlatBufferBuilder;
27+
import io.objectbox.flatbuffers.FloatVector;
28+
import io.objectbox.flatbuffers.IntVector;
29+
import io.objectbox.flatbuffers.LongVector;
30+
import io.objectbox.flatbuffers.ShortVector;
31+
import io.objectbox.flatbuffers.StringVector;
32+
import io.objectbox.flatbuffers.Struct;
33+
import io.objectbox.flatbuffers.Table;
34+
import io.objectbox.flatbuffers.UnionVector;
35+
import java.nio.ByteBuffer;
36+
import java.nio.ByteOrder;
2537

2638
/**
2739
* A model describes all entities and other meta data.
@@ -31,7 +43,7 @@
3143
*/
3244
@SuppressWarnings("unused")
3345
public final class Model extends Table {
34-
public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_8(); }
46+
public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); }
3547
public static Model getRootAsModel(ByteBuffer _bb) { return getRootAsModel(_bb, new Model()); }
3648
public static Model getRootAsModel(ByteBuffer _bb, Model obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
3749
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
Collapse file

‎objectbox-java/src/main/java/io/objectbox/model/ModelEntity.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/model/ModelEntity.java
+18-6Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2023 ObjectBox Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,14 +18,26 @@
1818

1919
package io.objectbox.model;
2020

21-
import java.nio.*;
22-
import java.lang.*;
23-
import java.util.*;
24-
import io.objectbox.flatbuffers.*;
21+
import io.objectbox.flatbuffers.BaseVector;
22+
import io.objectbox.flatbuffers.BooleanVector;
23+
import io.objectbox.flatbuffers.ByteVector;
24+
import io.objectbox.flatbuffers.Constants;
25+
import io.objectbox.flatbuffers.DoubleVector;
26+
import io.objectbox.flatbuffers.FlatBufferBuilder;
27+
import io.objectbox.flatbuffers.FloatVector;
28+
import io.objectbox.flatbuffers.IntVector;
29+
import io.objectbox.flatbuffers.LongVector;
30+
import io.objectbox.flatbuffers.ShortVector;
31+
import io.objectbox.flatbuffers.StringVector;
32+
import io.objectbox.flatbuffers.Struct;
33+
import io.objectbox.flatbuffers.Table;
34+
import io.objectbox.flatbuffers.UnionVector;
35+
import java.nio.ByteBuffer;
36+
import java.nio.ByteOrder;
2537

2638
@SuppressWarnings("unused")
2739
public final class ModelEntity extends Table {
28-
public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_8(); }
40+
public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); }
2941
public static ModelEntity getRootAsModelEntity(ByteBuffer _bb) { return getRootAsModelEntity(_bb, new ModelEntity()); }
3042
public static ModelEntity getRootAsModelEntity(ByteBuffer _bb, ModelEntity obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
3143
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.