Fixed
Status Update
Comments
da...@google.com <da...@google.com> #2
Looks like Room should have failed with a better message that byte[][] is not a supported DAO return type, instead of generating code that does not compile.
Can you elaborate more on your use case? What is the expected data for that method? How is it stored in the DB?
sh...@gmail.com <sh...@gmail.com> #3
No, It is a bug in Room Framework.
If I use this, it is work.
@Dao
interface DAO {
@Query("SELECT Column FROM Table")
fun queryAppInfo(): List<ByteArray>
}
Generate code is this following.
final List<byte[]> _result = new ArrayList<byte[]>(_cursor.getCount());
da...@google.com <da...@google.com>
el...@google.com <el...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 6fdc9c6da3c88fd90d4eb94a27904cb194c42c9f
Author: Elif Bilgin <elifbilgin@google.com>
Date: Tue Jan 11 16:56:21 2022
Resolving bug where Room generates invalid code for a Array<ByteArray> return type query method.
Test: DaoPrimitiveTest.kt
Bug: 213789489
Relnote: Resolving bug where Room generates code for a Array<ByteArray> return type query method.
Change-Id: If086ef555768089adea98f8ff20e785cb06f9597
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/DaoPrimitiveTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ArrayQueryResultAdapter.kt
https://android-review.googlesource.com/1947697
Branch: androidx-main
commit 6fdc9c6da3c88fd90d4eb94a27904cb194c42c9f
Author: Elif Bilgin <elifbilgin@google.com>
Date: Tue Jan 11 16:56:21 2022
Resolving bug where Room generates invalid code for a Array<ByteArray> return type query method.
Test: DaoPrimitiveTest.kt
Bug: 213789489
Relnote: Resolving bug where Room generates code for a Array<ByteArray> return type query method.
Change-Id: If086ef555768089adea98f8ff20e785cb06f9597
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/DaoPrimitiveTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ArrayQueryResultAdapter.kt
Description
Component used: androidx room
Version used: 2.4.0
Devices/Android versions reproduced on: Android SDK32
Here is a Kotlin DAO.
However, compileDebugJavaWithJavac FAILED, Because of this.