1 import androidx.paging.DataSource 2 import androidx.room.RoomDatabase 3 import androidx.room.RoomSQLiteQuery 4 import androidx.room.RoomSQLiteQuery.Companion.acquire 5 import androidx.room.paging.LimitOffsetDataSource 6 import androidx.room.util.getColumnIndexOrThrow 7 import androidx.sqlite.SQLiteStatement 8 import javax.`annotation`.processing.Generated 9 import kotlin.Int 10 import kotlin.Long 11 import kotlin.String 12 import kotlin.Suppress 13 import kotlin.collections.List 14 import kotlin.collections.MutableList 15 import kotlin.collections.mutableListOf 16 import kotlin.reflect.KClass 17 18 @Generated(value = ["androidx.room.RoomProcessor"]) 19 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"]) 20 public class MyDao_Impl( 21 __db: RoomDatabase, 22 ) : MyDao() { 23 private val __db: RoomDatabase 24 init { 25 this.__db = __db 26 } 27 getDataSourceFactorynull28 public override fun getDataSourceFactory(): DataSource.Factory<Int, MyEntity> { 29 val _sql: String = "SELECT * from MyEntity" 30 val _statement: RoomSQLiteQuery = acquire(_sql, 0) 31 return object : DataSource.Factory<Int, MyEntity>() { 32 public override fun create(): LimitOffsetDataSource<MyEntity> = object : LimitOffsetDataSource<MyEntity>(__db, _statement, false, true, "MyEntity") { 33 protected override fun convertRows(statement: SQLiteStatement): List<MyEntity> { 34 val _columnIndexOfPk: Int = getColumnIndexOrThrow(statement, "pk") 35 val _columnIndexOfOther: Int = getColumnIndexOrThrow(statement, "other") 36 val _res: MutableList<MyEntity> = mutableListOf() 37 while (statement.step()) { 38 val _item: MyEntity 39 val _tmpPk: Int 40 _tmpPk = statement.getLong(_columnIndexOfPk).toInt() 41 val _tmpOther: String 42 _tmpOther = statement.getText(_columnIndexOfOther) 43 _item = MyEntity(_tmpPk,_tmpOther) 44 _res.add(_item) 45 } 46 return _res 47 } 48 } 49 } 50 } 51 getDataSourceFactoryWithArgsnull52 public override fun getDataSourceFactoryWithArgs(gt: Long): DataSource.Factory<Int, MyEntity> { 53 val _sql: String = "SELECT * FROM MyEntity WHERE pk > ? ORDER BY pk ASC" 54 val _statement: RoomSQLiteQuery = acquire(_sql, 1) 55 var _argIndex: Int = 1 56 _statement.bindLong(_argIndex, gt) 57 return object : DataSource.Factory<Int, MyEntity>() { 58 public override fun create(): LimitOffsetDataSource<MyEntity> = object : LimitOffsetDataSource<MyEntity>(__db, _statement, false, true, "MyEntity") { 59 protected override fun convertRows(statement: SQLiteStatement): List<MyEntity> { 60 val _columnIndexOfPk: Int = getColumnIndexOrThrow(statement, "pk") 61 val _columnIndexOfOther: Int = getColumnIndexOrThrow(statement, "other") 62 val _res: MutableList<MyEntity> = mutableListOf() 63 while (statement.step()) { 64 val _item: MyEntity 65 val _tmpPk: Int 66 _tmpPk = statement.getLong(_columnIndexOfPk).toInt() 67 val _tmpOther: String 68 _tmpOther = statement.getText(_columnIndexOfOther) 69 _item = MyEntity(_tmpPk,_tmpOther) 70 _res.add(_item) 71 } 72 return _res 73 } 74 } 75 } 76 } 77 78 public companion object { getRequiredConvertersnull79 public fun getRequiredConverters(): List<KClass<*>> = emptyList() 80 } 81 } 82