Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 962835f929d5db276e39e5e6e98140a0a7e6ecb8
Author: elifbilgin <elifbilgin@google.com>
Date: Tue Aug 27 13:30:18 2024
Limit UUID support in DAOs to Android platform.
This is not migrated to common, and is resulting invalid codegen in non-Android platforms.
The issue was was reproduced and verified in the KMP test app by defining a database and a dao in the QueryTest.kt of the JVM desktop source set that had a DAO function returning an entity with an UUID column. The fix was verified as the failure to import `convertByteToUUID` function error was resolved, and replaced with a "Cannot figure out how to save this field into database. You can consider adding a type converter for it." error.
Adding a type converter allows for the test to pass successfully.
Bug: 362486575
Test: QueryTest.kt on JVM target
Change-Id: I5c9b8e4303ea337e47f6ef59a12a87347b0590dd
M room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
https://android-review.googlesource.com/3243958
Branch: androidx-main
commit 962835f929d5db276e39e5e6e98140a0a7e6ecb8
Author: elifbilgin <elifbilgin@google.com>
Date: Tue Aug 27 13:30:18 2024
Limit UUID support in DAOs to Android platform.
This is not migrated to common, and is resulting invalid codegen in non-Android platforms.
The issue was was reproduced and verified in the KMP test app by defining a database and a dao in the QueryTest.kt of the JVM desktop source set that had a DAO function returning an entity with an UUID column. The fix was verified as the failure to import `convertByteToUUID` function error was resolved, and replaced with a "Cannot figure out how to save this field into database. You can consider adding a type converter for it." error.
Adding a type converter allows for the test to pass successfully.
Bug: 362486575
Test: QueryTest.kt on JVM target
Change-Id: I5c9b8e4303ea337e47f6ef59a12a87347b0590dd
M room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
el...@google.com <el...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit c38accbe2c1dfc97e51e167a4b67696332d6ffe1
Author: elifbilgin <elifbilgin@google.com>
Date: Wed Sep 04 17:22:35 2024
Adding UUID support in JVM Desktop.
This change simply entails moving the UUIDUtil class to the jvmAndroid source set to make the conversion functions available to both Android and JVM sources. UUIDTest.kt has been added to the JVM source set of the Room KMP test app.
The previous fix to b/362486575 in the TypeAdapterStore has been reverted to enable UUID and ByteBuffer support in JVM Desktop.
Bug: 362994709
Test: UUIDTest.kt
Change-Id: I2330129032ad4351add358fa9799e3a028a21fad
A room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/UUIDTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/util/UUIDUtil.jvmAndroid.kt
https://android-review.googlesource.com/3255181
Branch: androidx-main
commit c38accbe2c1dfc97e51e167a4b67696332d6ffe1
Author: elifbilgin <elifbilgin@google.com>
Date: Wed Sep 04 17:22:35 2024
Adding UUID support in JVM Desktop.
This change simply entails moving the UUIDUtil class to the jvmAndroid source set to make the conversion functions available to both Android and JVM sources. UUIDTest.kt has been added to the JVM source set of the Room KMP test app.
The previous fix to
Bug: 362994709
Test: UUIDTest.kt
Change-Id: I2330129032ad4351add358fa9799e3a028a21fad
A room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/UUIDTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/util/UUIDUtil.jvmAndroid.kt
Description
When using a UUID field in an Entitiy, generated code fails for JVM since UUID conversion code is still android only but generated code is not aware of this.
So it generates the code that imports
import androidx.room.util.convertByteToUUID
and fails on jvm compilation.