Skip to content

Commit 23d2312

Browse files
committed
Update to FlatBuffers 1.11.1
1 parent 0740fb7 commit 23d2312

File tree

11 files changed

+51
-28
lines changed

11 files changed

+51
-28
lines changed

objectbox-java/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies {
1818
compile fileTree(include: ['*.jar'], dir: 'libs')
1919
compile project(':objectbox-java-api')
2020
compile 'org.greenrobot:essentials:3.0.0-RC1'
21-
compile 'com.google.flatbuffers:flatbuffers-java:1.9.0'
21+
compile 'com.google.flatbuffers:flatbuffers-java:1.11.1'
2222
compile 'com.google.code.findbugs:jsr305:3.0.2'
2323
}
2424

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.
@@ -32,8 +32,8 @@
3232
*/
3333
public final class Model extends Table {
3434
public static Model getRootAsModel(ByteBuffer _bb) { return getRootAsModel(_bb, new Model()); }
35-
public static Model getRootAsModel(ByteBuffer _bb, Model obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
36-
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
35+
public static Model getRootAsModel(ByteBuffer _bb, Model obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
36+
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
3737
public Model __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
3838

3939
/**
@@ -62,7 +62,7 @@ public final class Model extends Table {
6262
public IdUid lastRelationId() { return lastRelationId(new IdUid()); }
6363
public IdUid lastRelationId(IdUid obj) { int o = __offset(18); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
6464

65-
public static void startModel(FlatBufferBuilder builder) { builder.startObject(8); }
65+
public static void startModel(FlatBufferBuilder builder) { builder.startTable(8); }
6666
public static void addModelVersion(FlatBufferBuilder builder, long modelVersion) { builder.addInt(0, (int)modelVersion, (int)0L); }
6767
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
6868
public static void addVersion(FlatBufferBuilder builder, long version) { builder.addLong(2, version, 0L); }
@@ -74,7 +74,7 @@ public final class Model extends Table {
7474
public static void addLastSequenceId(FlatBufferBuilder builder, int lastSequenceIdOffset) { builder.addStruct(6, lastSequenceIdOffset, 0); }
7575
public static void addLastRelationId(FlatBufferBuilder builder, int lastRelationIdOffset) { builder.addStruct(7, lastRelationIdOffset, 0); }
7676
public static int endModel(FlatBufferBuilder builder) {
77-
int o = builder.endObject();
77+
int o = builder.endTable();
7878
return o;
7979
}
8080
public static void finishModelBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.
@@ -26,8 +26,8 @@
2626
@SuppressWarnings("unused")
2727
public final class ModelEntity extends Table {
2828
public static ModelEntity getRootAsModelEntity(ByteBuffer _bb) { return getRootAsModelEntity(_bb, new ModelEntity()); }
29-
public static ModelEntity getRootAsModelEntity(ByteBuffer _bb, ModelEntity obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
30-
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
29+
public static ModelEntity getRootAsModelEntity(ByteBuffer _bb, ModelEntity obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
30+
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
3131
public ModelEntity __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
3232

3333
public IdUid id() { return id(new IdUid()); }
@@ -54,7 +54,7 @@ public final class ModelEntity extends Table {
5454
public ByteBuffer nameSecondaryAsByteBuffer() { return __vector_as_bytebuffer(16, 1); }
5555
public ByteBuffer nameSecondaryInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 16, 1); }
5656

57-
public static void startModelEntity(FlatBufferBuilder builder) { builder.startObject(7); }
57+
public static void startModelEntity(FlatBufferBuilder builder) { builder.startTable(7); }
5858
public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addStruct(0, idOffset, 0); }
5959
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
6060
public static void addProperties(FlatBufferBuilder builder, int propertiesOffset) { builder.addOffset(2, propertiesOffset, 0); }
@@ -67,7 +67,7 @@ public final class ModelEntity extends Table {
6767
public static void addFlags(FlatBufferBuilder builder, long flags) { builder.addInt(5, (int)flags, (int)0L); }
6868
public static void addNameSecondary(FlatBufferBuilder builder, int nameSecondaryOffset) { builder.addOffset(6, nameSecondaryOffset, 0); }
6969
public static int endModelEntity(FlatBufferBuilder builder) {
70-
int o = builder.endObject();
70+
int o = builder.endTable();
7171
return o;
7272
}
7373
}

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2019 ObjectBox Ltd. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
// automatically generated by the FlatBuffers compiler, do not modify
218

319
package io.objectbox.model;
@@ -10,8 +26,8 @@
1026
@SuppressWarnings("unused")
1127
public final class ModelProperty extends Table {
1228
public static ModelProperty getRootAsModelProperty(ByteBuffer _bb) { return getRootAsModelProperty(_bb, new ModelProperty()); }
13-
public static ModelProperty getRootAsModelProperty(ByteBuffer _bb, ModelProperty obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
14-
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
29+
public static ModelProperty getRootAsModelProperty(ByteBuffer _bb, ModelProperty obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
30+
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
1531
public ModelProperty __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
1632

1733
public IdUid id() { return id(new IdUid()); }
@@ -49,7 +65,7 @@ public final class ModelProperty extends Table {
4965
*/
5066
public long maxIndexValueLength() { int o = __offset(20); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0L; }
5167

52-
public static void startModelProperty(FlatBufferBuilder builder) { builder.startObject(9); }
68+
public static void startModelProperty(FlatBufferBuilder builder) { builder.startTable(9); }
5369
public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addStruct(0, idOffset, 0); }
5470
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
5571
public static void addType(FlatBufferBuilder builder, int type) { builder.addShort(2, (short)type, (short)0); }
@@ -60,7 +76,7 @@ public final class ModelProperty extends Table {
6076
public static void addNameSecondary(FlatBufferBuilder builder, int nameSecondaryOffset) { builder.addOffset(7, nameSecondaryOffset, 0); }
6177
public static void addMaxIndexValueLength(FlatBufferBuilder builder, long maxIndexValueLength) { builder.addInt(8, (int)maxIndexValueLength, (int)0L); }
6278
public static int endModelProperty(FlatBufferBuilder builder) {
63-
int o = builder.endObject();
79+
int o = builder.endTable();
6480
return o;
6581
}
6682
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.
@@ -26,8 +26,8 @@
2626
@SuppressWarnings("unused")
2727
public final class ModelRelation extends Table {
2828
public static ModelRelation getRootAsModelRelation(ByteBuffer _bb) { return getRootAsModelRelation(_bb, new ModelRelation()); }
29-
public static ModelRelation getRootAsModelRelation(ByteBuffer _bb, ModelRelation obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
30-
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
29+
public static ModelRelation getRootAsModelRelation(ByteBuffer _bb, ModelRelation obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
30+
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
3131
public ModelRelation __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
3232

3333
public IdUid id() { return id(new IdUid()); }
@@ -38,12 +38,12 @@ public final class ModelRelation extends Table {
3838
public IdUid targetEntityId() { return targetEntityId(new IdUid()); }
3939
public IdUid targetEntityId(IdUid obj) { int o = __offset(8); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
4040

41-
public static void startModelRelation(FlatBufferBuilder builder) { builder.startObject(3); }
41+
public static void startModelRelation(FlatBufferBuilder builder) { builder.startTable(3); }
4242
public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addStruct(0, idOffset, 0); }
4343
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
4444
public static void addTargetEntityId(FlatBufferBuilder builder, int targetEntityIdOffset) { builder.addStruct(2, targetEntityIdOffset, 0); }
4545
public static int endModelRelation(FlatBufferBuilder builder) {
46-
int o = builder.endObject();
46+
int o = builder.endTable();
4747
return o;
4848
}
4949
}

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.
@@ -19,12 +19,14 @@
1919
package io.objectbox.model;
2020

2121
/**
22-
* Not really an enum, but binary flags to use across languages
22+
* Bit-flags defining the behavior of properties.
23+
* Note: Numbers indicate the bit position
2324
*/
2425
public final class PropertyFlags {
2526
private PropertyFlags() { }
2627
/**
27-
* One long property on an entity must be the ID
28+
* 64 bit long property (internally unsigned) representing the ID of the entity.
29+
* May be combined with: NON_PRIMITIVE_TYPE, ID_MONOTONIC_SEQUENCE, ID_SELF_ASSIGNABLE.
2830
*/
2931
public static final int ID = 1;
3032
/**
@@ -74,5 +76,10 @@ private PropertyFlags() { }
7476
* (recommended mostly for 64 bit machines with values longer >200 bytes; small values are faster with a 32 bit hash)
7577
*/
7678
public static final int INDEX_HASH64 = 4096;
79+
/**
80+
* Unused yet: While our default are signed ints, queries & indexes need do know signing info.
81+
* Note: Don't combine with ID (IDs are always unsigned internally).
82+
*/
83+
public static final int UNSIGNED = 8192;
7784
}
7885

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2019 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.

0 commit comments

Comments
 (0)