https://kotlinlang.org logo
#getting-started
Title
# getting-started
n

nilTheDev

10/28/2021, 3:26 AM
What is the exact equivalent of
int[]
of Java in Kotlin? I was using JDBI library and defined an abstract method like that,
Copy code
@SqlBatch(
    """
        // some database query
    """
)
fun updateMany(
    // some parameters
): List<Int>
As per the documentation, methods annotated with
@SqlBatch
should only return one of these,
int[]
long[]
or
boolean[]
. I thought
List<Int>
would work here. But it didn't. The exception I got is the following,
interface database.UserDao.updateMany method is annotated with @SqlBatch so should return void, int[], or boolean[] but is returning: interface java.util.List
Tried with
Array<Int>
as well. But it didn't work either. So, anybody knows what is the equivalent? Or is it an issue with the library?
e

ephemient

10/28/2021, 3:27 AM
IntArray
is a primitive
int[]
,
Array<Int>
is a boxed
Integer[]
👍 1
n

nilTheDev

10/28/2021, 3:29 AM
@ephemient Thanks. It worked.
2 Views