Status Update
Comments
a....@gmail.com <a....@gmail.com> #2
I have the same issue.
DAO:
@Transaction
@Query("SELECT * FROM product")
fun getAllProducts(): PagingSource<Int, Product>
Product:
data class Product(
val id: Int,
val brandId: Int,
@Relation(parentColumn = "id", entityColumn = "id")
val productEntity: ProductEntity
)
Entity:
@Entity(tableName = "product")
data class ProductEntity(
@PrimaryKey val id: Int,
val categoryId: Int,
val brandId: Int
)
versions:
paging = "3.3.2"
room = "2.7.0-alpha08"
room-bundled = "2.5.0-alpha08"
my...@gmail.com <my...@gmail.com> #3
Here is an example to reproduce the issue. run ./gradlew assembleDebug
to get the error.
el...@google.com <el...@google.com> #4
Thanks for your sample project/code snippets - we were able to reproduce the issue on our end, and are working on a fix. We'll update this bug once we have resolved the issue.
el...@google.com <el...@google.com>
sp...@gmail.com <sp...@gmail.com> #5
Is there a workaround for this issue?
da...@google.com <da...@google.com> #6
A workaround might be to avoid @Relation
and instead use a Map return type arg, but otherwise we are working on getting this fix for the next release.
sp...@gmail.com <sp...@gmail.com> #7
Thanks for the advice. For my case I have multiple relations. Temporarily, I changed it to a Flow<List>
. I'll wait for the next release to use PagingSource
.
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
Author: elifbilgin <
Link:
Fix broken Relation support in Room Paging KMP.
Expand for full commit details
Fix broken Relation support in Room Paging KMP.
This CL fixes an issue in code generation in Room Paging which emerged when using @Relation with PagingSource. The solution resolves the issue by declaring a new suspend convertRows() method that can acquire a connection to perform the query.
Bug: 369136627
Test: BaseQueryTest.kt
Relnote: Revisit the newly added convertRows() method signature to be a suspend function that receives a RawRoomQuery for room-paging.
Change-Id: Ie57b558e217ce995a7d3dfe772c314aabbfcda8c
Files:
- M
room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
- M
room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/binderprovider/MultiTypedPagingSourceQueryResultBinderProvider.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MultiTypedPagingSourceQueryResultBinder.kt
- M
room/room-compiler/src/test/test-data/common/input/LimitOffsetPagingSource.kt
- M
room/room-compiler/src/test/test-data/daoWriter/output/javac/withLambda/ComplexDao.java
- M
room/room-compiler/src/test/test-data/daoWriter/output/javac/withoutLambda/ComplexDao.java
- M
room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/multiTypedPagingSourceResultBinder.kt
- M
room/room-paging/bcv/native/current.txt
- M
room/room-paging/src/androidInstrumentedTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
- M
room/room-paging/src/androidMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.android.kt
- M
room/room-paging/src/commonMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.kt
- M
room/room-paging/src/commonMain/kotlin/androidx/room/paging/util/RoomPagingUtil.kt
- M
room/room-paging/src/jvmNativeMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.jvmNative.kt
Hash: 1abf563063f91b5459a43da0b533822c34ced782
Date: Mon Sep 23 17:29:24 2024
el...@google.com <el...@google.com>
ba...@gmail.com <ba...@gmail.com> #9
Thanks!!!
el...@google.com <el...@google.com> #10
Version 2.7.0-alpha11 should be the one to include this fix!
pr...@google.com <pr...@google.com> #11
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-compiler:2.7.0-alpha11
androidx.room:room-paging:2.7.0-alpha11
androidx.room:room-paging-android:2.7.0-alpha11
androidx.room:room-paging-iosarm64:2.7.0-alpha11
androidx.room:room-paging-iossimulatorarm64:2.7.0-alpha11
androidx.room:room-paging-iosx64:2.7.0-alpha11
androidx.room:room-paging-jvm:2.7.0-alpha11
androidx.room:room-paging-linuxarm64:2.7.0-alpha11
androidx.room:room-paging-linuxx64:2.7.0-alpha11
androidx.room:room-paging-macosarm64:2.7.0-alpha11
androidx.room:room-paging-macosx64:2.7.0-alpha11
Description