Skip to content

Commit 38fbcd8

Browse files
committed
using io.objectbox:objectbox-generator:0.9.7-RC, fixing generated stuff
1 parent c5a0b52 commit 38fbcd8

3 files changed

Lines changed: 21 additions & 14 deletions

File tree

tests/test-proguard/src/main/java/io/objectbox/test/proguard/MyObjectBox.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ public static BoxStoreBuilder builder() {
2525

2626
private static byte[] getModel() {
2727
ModelBuilder modelBuilder = new ModelBuilder();
28+
modelBuilder.lastEntityId(1, 1001L);
29+
modelBuilder.lastIndexId(0, 0L);
2830

2931
EntityBuilder entityBuilder;
3032

3133
entityBuilder = modelBuilder.entity("ObfuscatedEntity");
32-
entityBuilder.property("id", PropertyType.Long)
34+
entityBuilder.id(1, 1001L).lastPropertyId(3, 1004L);
35+
entityBuilder.property("id", PropertyType.Long).id(1, 1002L)
3336
.flags(PropertyFlags.ID);
34-
entityBuilder.property("myInt", PropertyType.Int);
35-
entityBuilder.property("myString", PropertyType.String);
37+
entityBuilder.property("myInt", PropertyType.Int).id(2, 1003L);
38+
entityBuilder.property("myString", PropertyType.String).id(3, 1004L);
3639
entityBuilder.entityDone();
3740

3841
return modelBuilder.build();

tests/test-proguard/src/main/java/io/objectbox/test/proguard/ObfuscatedEntityCursor.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@
44
import io.objectbox.Cursor;
55
import io.objectbox.Properties;
66
import io.objectbox.Transaction;
7+
import io.objectbox.annotation.apihint.Temporary;
78

89
// THIS CODE IS GENERATED BY ObjectBox, DO NOT EDIT.
910

1011
/**
1112
* Cursor for DB entity "ObfuscatedEntity".
1213
*/
13-
public class ObfuscatedEntityCursor extends Cursor<ObfuscatedEntity> {
14+
public final class ObfuscatedEntityCursor extends Cursor<ObfuscatedEntity> {
1415

1516
private static Properties PROPERTIES = new ObfuscatedEntity_();
1617

1718

18-
private final int _myIntId;
19-
private final int _myStringId;
19+
// Property IDs get verified in Cursor base class
20+
private final static int __ID_myInt = ObfuscatedEntity_.myInt.id;
21+
private final static int __ID_myString = ObfuscatedEntity_.myString.id;
2022

2123
public ObfuscatedEntityCursor(Transaction tx, long cursor) {
2224
super(tx, cursor, PROPERTIES);
23-
_myIntId = getPropertyId("myInt");
24-
_myStringId = getPropertyId("myString");
25+
}
26+
27+
@Temporary
28+
public ObfuscatedEntityCursor() {
2529
}
2630

2731
@Override
@@ -37,12 +41,12 @@ public final long getId(ObfuscatedEntity entity) {
3741
@Override
3842
public final long put(ObfuscatedEntity entity) {
3943
String myString = entity.getMyString();
40-
int _id2 = myString != null ? _myStringId : 0;
44+
int __id2 = myString != null ? __ID_myString : 0;
4145

4246
long __assignedId = collect313311(cursor, entity.getId(), PUT_FLAG_FIRST | PUT_FLAG_COMPLETE,
43-
_id2, myString, 0, null,
47+
__id2, myString, 0, null,
4448
0, null, 0, null,
45-
_myIntId, entity.getMyInt(), 0, 0,
49+
__ID_myInt, entity.getMyInt(), 0, 0,
4650
0, 0, 0, 0,
4751
0, 0, 0, 0,
4852
0, 0, 0, 0);

tests/test-proguard/src/main/java/io/objectbox/test/proguard/ObfuscatedEntity_.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public class ObfuscatedEntity_ implements Properties {
1313

1414
public static final String __NAME_IN_DB = "ObfuscatedEntity";
1515

16-
public final static Property id = new Property(0, 0, long.class, "id", true, "id");
17-
public final static Property myInt = new Property(1, 0, int.class, "myInt");
18-
public final static Property myString = new Property(2, 0, String.class, "myString");
16+
public final static Property id = new Property(0, 1, long.class, "id", true, "id");
17+
public final static Property myInt = new Property(1, 2, int.class, "myInt");
18+
public final static Property myString = new Property(2, 3, String.class, "myString");
1919

2020
public final static Property[] __ALL_PROPERTIES = {
2121
id,

0 commit comments

Comments
 (0)