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+
117package io.objectbox.query
218
319import io.objectbox.TestEntity_
@@ -19,7 +35,8 @@ class QueryTestK : AbstractQueryTest() {
1935 val resultJava = box.query().`in `(TestEntity_ .simpleLong, valuesLong).build().use {
2036 it.findFirst()
2137 }
22- val result = box.query {
38+ // Keep testing the old query API on purpose
39+ @Suppress(" DEPRECATION" ) val result = box.query {
2340 inValues(TestEntity_ .simpleLong, valuesLong)
2441 }.use {
2542 it.findFirst()
@@ -33,8 +50,8 @@ class QueryTestK : AbstractQueryTest() {
3350 putTestEntity(" Fry" , 12 )
3451 putTestEntity(" Fry" , 10 )
3552
36- // current query API
37- val query = box.query {
53+ // Old query API
54+ @Suppress( " DEPRECATION " ) val query = box.query {
3855 less(TestEntity_ .simpleInt, 12 )
3956 or ()
4057 inValues(TestEntity_ .simpleLong, longArrayOf(1012 ))
@@ -46,7 +63,7 @@ class QueryTestK : AbstractQueryTest() {
4663 assertEquals(10 , results[0 ].simpleInt)
4764 assertEquals(12 , results[1 ].simpleInt)
4865
49- // suggested query API
66+ // New query API
5067 val newQuery = box.query(
5168 (TestEntity_ .simpleInt less 12 or (TestEntity_ .simpleLong oneOf longArrayOf(1012 )))
5269 and (TestEntity_ .simpleString equal " Fry" )
0 commit comments