Skip to content

Commit 7652c9a

Browse files
Test cursors: drop redundant final, clean up.
1 parent ed4353f commit 7652c9a

File tree

9 files changed

+20
-73
lines changed

9 files changed

+20
-73
lines changed

tests/objectbox-java-test/src/main/java/io/objectbox/TestEntityCursor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public TestEntityCursor(io.objectbox.Transaction tx, long cursor, BoxStore boxSt
7070
}
7171

7272
@Override
73-
public final long getId(TestEntity entity) {
73+
public long getId(TestEntity entity) {
7474
return ID_GETTER.getId(entity);
7575
}
7676

@@ -80,7 +80,7 @@ public final long getId(TestEntity entity) {
8080
* @return The ID of the object within its box.
8181
*/
8282
@Override
83-
public final long put(TestEntity entity) {
83+
public long put(TestEntity entity) {
8484
String[] simpleStringArray = entity.getSimpleStringArray();
8585
int __id10 = simpleStringArray != null ? __ID_simpleStringArray : 0;
8686

tests/objectbox-java-test/src/main/java/io/objectbox/index/model/EntityLongIndexCursor.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import io.objectbox.BoxStore;
2121
import io.objectbox.Cursor;
22-
import io.objectbox.EntityInfo;
2322
import io.objectbox.Transaction;
2423

2524
// THIS CODE was originally GENERATED BY ObjectBox.
@@ -29,9 +28,6 @@
2928
*/
3029
public final class EntityLongIndexCursor extends Cursor<EntityLongIndex> {
3130

32-
private static EntityInfo PROPERTIES = new EntityLongIndex_();
33-
34-
3531
// Property IDs get verified in Cursor base class
3632
private final static int __ID_indexedLong = EntityLongIndex_.indexedLong.id;
3733
private final static int __ID_float1 = EntityLongIndex_.float1.id;
@@ -41,11 +37,11 @@ public final class EntityLongIndexCursor extends Cursor<EntityLongIndex> {
4137
private final static int __ID_float5 = EntityLongIndex_.float5.id;
4238

4339
public EntityLongIndexCursor(Transaction tx, long cursor, BoxStore boxStore) {
44-
super(tx, cursor, PROPERTIES, boxStore);
40+
super(tx, cursor, EntityLongIndex_.__INSTANCE, boxStore);
4541
}
4642

4743
@Override
48-
public final long getId(EntityLongIndex entity) {
44+
public long getId(EntityLongIndex entity) {
4945
return entity.getId();
5046
}
5147

@@ -55,7 +51,7 @@ public final long getId(EntityLongIndex entity) {
5551
* @return The ID of the object within its box.
5652
*/
5753
@Override
58-
public final long put(EntityLongIndex entity) {
54+
public long put(EntityLongIndex entity) {
5955
Float float1 = entity.float1;
6056
int __id2 = float1 != null ? __ID_float1 : 0;
6157
Float float2 = entity.float2;
@@ -84,9 +80,4 @@ public final long put(EntityLongIndex entity) {
8480
return __assignedId;
8581
}
8682

87-
// TODO do we need this? @Override
88-
protected final boolean isEntityUpdateable() {
89-
return true;
90-
}
91-
9283
}

tests/objectbox-java-test/src/main/java/io/objectbox/relation/CustomerCursor.java

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
package io.objectbox.relation;
1818

1919

20-
import java.util.List;
21-
2220
import io.objectbox.BoxStore;
2321
import io.objectbox.Cursor;
24-
import io.objectbox.EntityInfo;
2522
import io.objectbox.Transaction;
2623
import io.objectbox.internal.CursorFactory;
2724

@@ -38,18 +35,15 @@ public Cursor<Customer> createCursor(Transaction tx, long cursorHandle, BoxStore
3835
}
3936
}
4037

41-
private static EntityInfo PROPERTIES = new Customer_();
42-
43-
4438
// Property IDs get verified in Cursor base class
4539
private final static int __ID_name = Customer_.name.id;
4640

4741
public CustomerCursor(Transaction tx, long cursor, BoxStore boxStore) {
48-
super(tx, cursor, PROPERTIES, boxStore);
42+
super(tx, cursor, Customer_.__INSTANCE, boxStore);
4943
}
5044

5145
@Override
52-
public final long getId(Customer entity) {
46+
public long getId(Customer entity) {
5347
return entity.getId();
5448
}
5549

@@ -59,7 +53,7 @@ public final long getId(Customer entity) {
5953
* @return The ID of the object within its box.
6054
*/
6155
@Override
62-
public final long put(Customer entity) {
56+
public long put(Customer entity) {
6357
String name = entity.getName();
6458
int __id1 = name != null ? __ID_name : 0;
6559

@@ -80,15 +74,4 @@ public final long put(Customer entity) {
8074
return __assignedId;
8175
}
8276

83-
// TODO @Override
84-
protected final void attachEntity(Customer entity) {
85-
// TODO super.attachEntity(entity);
86-
entity.__boxStore = boxStoreForEntities;
87-
}
88-
89-
// TODO do we need this? @Override
90-
protected final boolean isEntityUpdateable() {
91-
return true;
92-
}
93-
9477
}

tests/objectbox-java-test/src/main/java/io/objectbox/relation/OrderCursor.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public OrderCursor(Transaction tx, long cursor, BoxStore boxStore) {
4848
}
4949

5050
@Override
51-
public final long getId(Order entity) {
51+
public long getId(Order entity) {
5252
return ID_GETTER.getId(entity);
5353
}
5454

@@ -58,7 +58,7 @@ public final long getId(Order entity) {
5858
* @return The ID of the object within its box.
5959
*/
6060
@Override
61-
public final long put(Order entity) {
61+
public long put(Order entity) {
6262
if(entity.customer__toOne.internalRequiresPutTarget()) {
6363
Cursor<Customer> targetCursor = getRelationTargetCursor(Customer.class);
6464
try {
@@ -85,31 +85,4 @@ public final long put(Order entity) {
8585
return __assignedId;
8686
}
8787

88-
// TODO @Override
89-
protected final void attachEntity(Order entity) {
90-
// TODO super.attachEntity(entity);
91-
//entity.__boxStore = boxStoreForEntities;
92-
}
93-
94-
// TODO do we need this? @Override
95-
protected final boolean isEntityUpdateable() {
96-
return true;
97-
}
98-
99-
/** Internal query to resolve the "orders" to-many relationship of Customer. */
100-
/* TODO
101-
public List<Order> _queryCustomer_Orders(long customerId) {
102-
synchronized (this) {
103-
if (customer_OrdersQuery == null) {
104-
QueryBuilder<Order> queryBuilder = queryBuilder();
105-
queryBuilder.where(Properties.customerId.eq(null));
106-
customer_OrdersQuery = queryBuilder.build();
107-
}
108-
}
109-
Query<Order> query = customer_OrdersQuery.forCurrentThread();
110-
query.setParameter(0, customerId);
111-
return query.list();
112-
}
113-
*/
114-
11588
}

tests/objectbox-java-test/src/test/java/io/objectbox/tree/DataBranchCursor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public DataBranchCursor(io.objectbox.Transaction tx, long cursor, BoxStore boxSt
3333
}
3434

3535
@Override
36-
public final long getId(DataBranch entity) {
36+
public long getId(DataBranch entity) {
3737
return ID_GETTER.getId(entity);
3838
}
3939

@@ -43,7 +43,7 @@ public final long getId(DataBranch entity) {
4343
* @return The ID of the object within its box.
4444
*/
4545
@Override
46-
public final long put(DataBranch entity) {
46+
public long put(DataBranch entity) {
4747
ToOne<DataBranch> parent = entity.parent;
4848
if(parent != null && parent.internalRequiresPutTarget()) {
4949
Cursor<DataBranch> targetCursor = getRelationTargetCursor(DataBranch.class);

tests/objectbox-java-test/src/test/java/io/objectbox/tree/DataLeafCursor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public DataLeafCursor(io.objectbox.Transaction tx, long cursor, BoxStore boxStor
3636
}
3737

3838
@Override
39-
public final long getId(DataLeaf entity) {
39+
public long getId(DataLeaf entity) {
4040
return ID_GETTER.getId(entity);
4141
}
4242

@@ -46,7 +46,7 @@ public final long getId(DataLeaf entity) {
4646
* @return The ID of the object within its box.
4747
*/
4848
@Override
49-
public final long put(DataLeaf entity) {
49+
public long put(DataLeaf entity) {
5050
ToOne<DataBranch> dataBranch = entity.dataBranch;
5151
if(dataBranch != null && dataBranch.internalRequiresPutTarget()) {
5252
Cursor<DataBranch> targetCursor = getRelationTargetCursor(DataBranch.class);

tests/objectbox-java-test/src/test/java/io/objectbox/tree/MetaBranchCursor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public MetaBranchCursor(io.objectbox.Transaction tx, long cursor, BoxStore boxSt
3333
}
3434

3535
@Override
36-
public final long getId(MetaBranch entity) {
36+
public long getId(MetaBranch entity) {
3737
return ID_GETTER.getId(entity);
3838
}
3939

@@ -43,7 +43,7 @@ public final long getId(MetaBranch entity) {
4343
* @return The ID of the object within its box.
4444
*/
4545
@Override
46-
public final long put(MetaBranch entity) {
46+
public long put(MetaBranch entity) {
4747
ToOne<MetaBranch> parent = entity.parent;
4848
if(parent != null && parent.internalRequiresPutTarget()) {
4949
Cursor<MetaBranch> targetCursor = getRelationTargetCursor(MetaBranch.class);

tests/objectbox-java-test/src/test/java/io/objectbox/tree/MetaLeafCursor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public MetaLeafCursor(io.objectbox.Transaction tx, long cursor, BoxStore boxStor
3939
}
4040

4141
@Override
42-
public final long getId(MetaLeaf entity) {
42+
public long getId(MetaLeaf entity) {
4343
return ID_GETTER.getId(entity);
4444
}
4545

@@ -49,7 +49,7 @@ public final long getId(MetaLeaf entity) {
4949
* @return The ID of the object within its box.
5050
*/
5151
@Override
52-
public final long put(MetaLeaf entity) {
52+
public long put(MetaLeaf entity) {
5353
ToOne<MetaBranch> branch = entity.branch;
5454
if(branch != null && branch.internalRequiresPutTarget()) {
5555
Cursor<MetaBranch> targetCursor = getRelationTargetCursor(MetaBranch.class);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public ObfuscatedEntityCursor(Transaction tx, long cursor, BoxStore boxStore) {
4848
}
4949

5050
@Override
51-
public final long getId(ObfuscatedEntity entity) {
51+
public long getId(ObfuscatedEntity entity) {
5252
return ID_GETTER.getId(entity);
5353
}
5454

@@ -58,7 +58,7 @@ public final long getId(ObfuscatedEntity entity) {
5858
* @return The ID of the object within its box.
5959
*/
6060
@Override
61-
public final long put(ObfuscatedEntity entity) {
61+
public long put(ObfuscatedEntity entity) {
6262
String myString = entity.getMyString();
6363
int __id2 = myString != null ? __ID_myString : 0;
6464

0 commit comments

Comments
 (0)