Skip to content

Commit b109987

Browse files
committed
add secondaryName to model
1 parent f071370 commit b109987

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public final class Model extends Table {
4545
*/
4646
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
4747
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
48+
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
4849
/**
4950
* User controlled version, not really used at the moment
5051
*/

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public final class ModelEntity extends Table {
3434
public IdUid id(IdUid obj) { int o = __offset(4); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
3535
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
3636
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
37+
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
3738
public ModelProperty properties(int j) { return properties(new ModelProperty(), j); }
3839
public ModelProperty properties(ModelProperty obj, int j) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
3940
public int propertiesLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }
@@ -46,8 +47,14 @@ public final class ModelEntity extends Table {
4647
* Can be language specific, e.g. if no-args constructor should be used
4748
*/
4849
public long flags() { int o = __offset(14); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0L; }
50+
/**
51+
* Secondary name ignored by core; e.g. may reference a binding specific name (e.g. Java class)
52+
*/
53+
public String nameSecondary() { int o = __offset(16); return o != 0 ? __string(o + bb_pos) : null; }
54+
public ByteBuffer nameSecondaryAsByteBuffer() { return __vector_as_bytebuffer(16, 1); }
55+
public ByteBuffer nameSecondaryInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 16, 1); }
4956

50-
public static void startModelEntity(FlatBufferBuilder builder) { builder.startObject(6); }
57+
public static void startModelEntity(FlatBufferBuilder builder) { builder.startObject(7); }
5158
public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addStruct(0, idOffset, 0); }
5259
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
5360
public static void addProperties(FlatBufferBuilder builder, int propertiesOffset) { builder.addOffset(2, propertiesOffset, 0); }
@@ -58,6 +65,7 @@ public final class ModelEntity extends Table {
5865
public static int createRelationsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
5966
public static void startRelationsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
6067
public static void addFlags(FlatBufferBuilder builder, long flags) { builder.addInt(5, (int)flags, (int)0L); }
68+
public static void addNameSecondary(FlatBufferBuilder builder, int nameSecondaryOffset) { builder.addOffset(6, nameSecondaryOffset, 0); }
6169
public static int endModelEntity(FlatBufferBuilder builder) {
6270
int o = builder.endObject();
6371
return o;

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public final class ModelProperty extends Table {
3434
public IdUid id(IdUid obj) { int o = __offset(4); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
3535
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
3636
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
37+
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
3738
public int type() { int o = __offset(8); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
3839
/**
3940
* bit flags: e.g. indexed, not-nullable
@@ -46,20 +47,29 @@ public final class ModelProperty extends Table {
4647
*/
4748
public String targetEntity() { int o = __offset(14); return o != 0 ? __string(o + bb_pos) : null; }
4849
public ByteBuffer targetEntityAsByteBuffer() { return __vector_as_bytebuffer(14, 1); }
50+
public ByteBuffer targetEntityInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 14, 1); }
4951
/**
5052
* E.g. for virtual to-one target ID properties, this references the ToOne object
5153
*/
5254
public String virtualTarget() { int o = __offset(16); return o != 0 ? __string(o + bb_pos) : null; }
5355
public ByteBuffer virtualTargetAsByteBuffer() { return __vector_as_bytebuffer(16, 1); }
56+
public ByteBuffer virtualTargetInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 16, 1); }
57+
/**
58+
* Secondary name ignored by core; e.g. may reference a binding specific name (e.g. Java property)
59+
*/
60+
public String nameSecondary() { int o = __offset(18); return o != 0 ? __string(o + bb_pos) : null; }
61+
public ByteBuffer nameSecondaryAsByteBuffer() { return __vector_as_bytebuffer(18, 1); }
62+
public ByteBuffer nameSecondaryInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 18, 1); }
5463

55-
public static void startModelProperty(FlatBufferBuilder builder) { builder.startObject(7); }
64+
public static void startModelProperty(FlatBufferBuilder builder) { builder.startObject(8); }
5665
public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addStruct(0, idOffset, 0); }
5766
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
5867
public static void addType(FlatBufferBuilder builder, int type) { builder.addShort(2, (short)type, (short)0); }
5968
public static void addFlags(FlatBufferBuilder builder, long flags) { builder.addInt(3, (int)flags, (int)0L); }
6069
public static void addIndexId(FlatBufferBuilder builder, int indexIdOffset) { builder.addStruct(4, indexIdOffset, 0); }
6170
public static void addTargetEntity(FlatBufferBuilder builder, int targetEntityOffset) { builder.addOffset(5, targetEntityOffset, 0); }
6271
public static void addVirtualTarget(FlatBufferBuilder builder, int virtualTargetOffset) { builder.addOffset(6, virtualTargetOffset, 0); }
72+
public static void addNameSecondary(FlatBufferBuilder builder, int nameSecondaryOffset) { builder.addOffset(7, nameSecondaryOffset, 0); }
6373
public static int endModelProperty(FlatBufferBuilder builder) {
6474
int o = builder.endObject();
6575
return o;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public final class ModelRelation extends Table {
3434
public IdUid id(IdUid obj) { int o = __offset(4); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
3535
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
3636
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
37+
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
3738
public IdUid targetEntityId() { return targetEntityId(new IdUid()); }
3839
public IdUid targetEntityId(IdUid obj) { int o = __offset(8); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
3940

0 commit comments

Comments
 (0)