1
+ /*
2
+ * Copyright 2020-2025 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
+
1
17
package io.objectbox.query
2
18
3
19
import io.objectbox.TestEntity_
@@ -19,7 +35,8 @@ class QueryTestK : AbstractQueryTest() {
19
35
val resultJava = box.query().`in `(TestEntity_ .simpleLong, valuesLong).build().use {
20
36
it.findFirst()
21
37
}
22
- val result = box.query {
38
+ // Keep testing the old query API on purpose
39
+ @Suppress(" DEPRECATION" ) val result = box.query {
23
40
inValues(TestEntity_ .simpleLong, valuesLong)
24
41
}.use {
25
42
it.findFirst()
@@ -33,8 +50,8 @@ class QueryTestK : AbstractQueryTest() {
33
50
putTestEntity(" Fry" , 12 )
34
51
putTestEntity(" Fry" , 10 )
35
52
36
- // current query API
37
- val query = box.query {
53
+ // Old query API
54
+ @Suppress( " DEPRECATION " ) val query = box.query {
38
55
less(TestEntity_ .simpleInt, 12 )
39
56
or ()
40
57
inValues(TestEntity_ .simpleLong, longArrayOf(1012 ))
@@ -46,7 +63,7 @@ class QueryTestK : AbstractQueryTest() {
46
63
assertEquals(10 , results[0 ].simpleInt)
47
64
assertEquals(12 , results[1 ].simpleInt)
48
65
49
- // suggested query API
66
+ // New query API
50
67
val newQuery = box.query(
51
68
(TestEntity_ .simpleInt less 12 or (TestEntity_ .simpleLong oneOf longArrayOf(1012 )))
52
69
and (TestEntity_ .simpleString equal " Fry" )
0 commit comments