Skip to content

Commit 052be73

Browse files
Tests: match generated code for TestEntity meta and cursor class
1 parent e85633a commit 052be73

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

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

Lines changed: 6 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 2017-2024 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.
@@ -16,14 +16,16 @@
1616

1717
package io.objectbox;
1818

19+
import java.util.Map;
20+
1921
import io.objectbox.annotation.apihint.Internal;
2022
import io.objectbox.converter.FlexObjectConverter;
2123
import io.objectbox.converter.StringFlexMapConverter;
2224
import io.objectbox.internal.CursorFactory;
2325

24-
import java.util.Map;
26+
// NOTE: Instead of updating this by hand, copy changes from the internal integration test project after updating its
27+
// TestEntity. But make sure to keep the INT_NULL_HACK to make it work with tests here.
2528

26-
// NOTE: Copied from a plugin project (& removed some unused Properties).
2729
// THIS CODE IS GENERATED BY ObjectBox, DO NOT EDIT.
2830

2931
/**
@@ -86,6 +88,7 @@ public long getId(TestEntity entity) {
8688
*
8789
* @return The ID of the object within its box.
8890
*/
91+
@SuppressWarnings({"rawtypes", "unchecked"})
8992
@Override
9093
public long put(TestEntity entity) {
9194
short[] shortArray = entity.getShortArray();

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
/*
3-
* Copyright 2017 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2017-2024 ObjectBox Ltd. All rights reserved.
43
*
54
* Licensed under the Apache License, Version 2.0 (the "License");
65
* you may not use this file except in compliance with the License.
@@ -17,16 +16,18 @@
1716

1817
package io.objectbox;
1918

19+
import java.util.Map;
20+
2021
import io.objectbox.TestEntityCursor.Factory;
2122
import io.objectbox.annotation.apihint.Internal;
2223
import io.objectbox.converter.FlexObjectConverter;
2324
import io.objectbox.converter.StringFlexMapConverter;
2425
import io.objectbox.internal.CursorFactory;
2526
import io.objectbox.internal.IdGetter;
2627

27-
import java.util.Map;
28+
// NOTE: Instead of updating this by hand, copy changes from the internal integration test project after updating its
29+
// TestEntity.
2830

29-
// NOTE: Copied from a plugin project (& removed some unused Properties).
3031
// THIS CODE IS GENERATED BY ObjectBox, DO NOT EDIT.
3132

3233
/**
@@ -82,7 +83,7 @@ public final class TestEntity_ implements EntityInfo<TestEntity> {
8283
new io.objectbox.Property<>(__INSTANCE, 9, 10, byte[].class, "simpleByteArray");
8384

8485
public final static io.objectbox.Property<TestEntity> simpleStringArray =
85-
new io.objectbox.Property<>(__INSTANCE, 10, 11, String[].class, "simpleStringArray", false, "simpleStringArray");
86+
new io.objectbox.Property<>(__INSTANCE, 10, 11, String[].class, "simpleStringArray");
8687

8788
public final static io.objectbox.Property<TestEntity> simpleStringList =
8889
new io.objectbox.Property<>(__INSTANCE, 11, 15, java.util.List.class, "simpleStringList");
@@ -103,19 +104,19 @@ public final class TestEntity_ implements EntityInfo<TestEntity> {
103104
new io.objectbox.Property<>(__INSTANCE, 16, 17, byte[].class, "flexProperty", false, "flexProperty", FlexObjectConverter.class, Object.class);
104105

105106
public final static io.objectbox.Property<TestEntity> shortArray =
106-
new io.objectbox.Property<>(__INSTANCE, 17, 19, short[].class, "shortArray");
107+
new io.objectbox.Property<>(__INSTANCE, 17, 18, short[].class, "shortArray");
107108

108109
public final static io.objectbox.Property<TestEntity> charArray =
109-
new io.objectbox.Property<>(__INSTANCE, 18, 20, char[].class, "charArray");
110+
new io.objectbox.Property<>(__INSTANCE, 18, 19, char[].class, "charArray");
110111

111112
public final static io.objectbox.Property<TestEntity> intArray =
112-
new io.objectbox.Property<>(__INSTANCE, 19, 21, int[].class, "intArray");
113+
new io.objectbox.Property<>(__INSTANCE, 19, 20, int[].class, "intArray");
113114

114115
public final static io.objectbox.Property<TestEntity> longArray =
115-
new io.objectbox.Property<>(__INSTANCE, 20, 22, long[].class, "longArray");
116+
new io.objectbox.Property<>(__INSTANCE, 20, 21, long[].class, "longArray");
116117

117118
public final static io.objectbox.Property<TestEntity> floatArray =
118-
new io.objectbox.Property<>(__INSTANCE, 21, 18, float[].class, "floatArray");
119+
new io.objectbox.Property<>(__INSTANCE, 21, 22, float[].class, "floatArray");
119120

120121
public final static io.objectbox.Property<TestEntity> doubleArray =
121122
new io.objectbox.Property<>(__INSTANCE, 22, 23, double[].class, "doubleArray");

0 commit comments

Comments
 (0)