Brandon Trautmann
04/11/2019, 1:34 AMFlowable
, Maybe
, etc. but I don't something like that for coroutines in 2.1.0
Parthiv Mistri
01/17/2020, 7:12 AM@Entity
@TypeConverters(TeamModelTypeConverters::class)
data class User(
@PrimaryKey var id: Int? = null,
var team: List<TeamModel>? = null,
var organization_l1: OrganizationModel? = null,
var organization_l2: OrganizationModel? = null,
)
As you can see I have OrganizationModel
in 2 place. I can not use @Embedded
As it will give me error regarding same field while creating a table.
Can Anyone help me on this?
Thankskyleg
01/26/2020, 10:07 PMdata class Foo(val x: Int, val y: String)
@Dao interface MyDao {
@Query("...")
private suspend fun _getData(x: Int, y: String): Int
suspend fun getData(foo: Foo) = _getData(foo.x, foo.y)
}
But I get an error when trying to build my project:
error: MyDao_Impl is not abstract and does not override abstract method getData(......
How do I resolve this without forcing a non-DAO function to do the unwrapping?Roar Gronmo
01/30/2020, 8:18 PM@Query("SELECT * FROM stations WHERE stationId = :stationId LIMIT 1")
fun getStation(stationId: String): Station
What will happen if ":stationID" is not found, how is that element returned, null ?
Above expression is set as "nullsafe" (No warning telling that I should return Station?
instead,) and handle the null check in my code.
AS should give a Lint Error/Warning here to tell that the result may return null.
My app fails at this point when handling a null (that obviously shouldn't be null...)
RGPablo
08/18/2020, 2:20 PM*.db
script to initialise the database and I don't know if it will break something.
[1] : https://stackoverflow.com/questions/63382855/how-to-add-embedded-and-relation-to-room-databaseJoan Colmenero
08/20/2020, 1:30 PMcreateFromAsset(file path of db)
but looks like is not updating the db when inserting or deleting, whell for the first time it does populate everything that I have, then when I update the data and check the DB Browser for SQLite is not being reflected and when I close the app and open it again it keeps the same data as the start. Any idea?Andy Gibel
09/09/2020, 5:00 PMpollux-
09/14/2020, 11:40 PMMarcin Środa
10/01/2020, 12:47 PMFlow
in Room? Easy queries works fine, but what if I wan’t to use more extended like:
@Query("SELECT id, (SELECT COUNT(id) FROM `message` WHERE channelId = channel.id and timestamp > channel.custom_readAt) as `unreadCount` FROM `channel`")
fun getAll(): Flow<List<UnreadMessageData>>
the new value is not emited. But in DatabaseInspector with ‘live update’ enabled it works fine. Any ideas?Saul Wiggin
10/26/2020, 11:42 AMpublic final class DatabaseBitcoin {
^
Tried the following constructors but they failed to match:
DatabaseBitcoin(int,com.example.paywithbitcoin.database.Time,java.lang.String,java.lang.String,java.util.List<com.example.paywithbitcoin.database.Currency>) -> [param:id -> matched field:id, param:time -> matched field:unmatched, param:disclaimer -> matched field:disclaimer, param:chartname -> matched field:chartname, param:bpi -> matched field:unmatched]/Users/drsilaswiggin/dev/kotlin/PayWithBitcoin/app/build/tmp/kapt3/stubs/debug/com/example/paywithbitcoin/database/DatabaseBitcoin.java:7: error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
Mohsen
11/15/2020, 6:05 PMconst val FORECAST_ID = 0
@Entity(tableName = "forecast")
data class ForecastEntry(
@Ignore
@Embedded(prefix = "current_")
val current: Current = Current(),
@Ignore
@Embedded(prefix = "daily_")
val daily: List<Daily> = listOf(),
@Ignore
@Embedded(prefix = "hourly_")
val hourly: List<Hourly> = listOf(),
@Ignore
val lat: Double = 0.0,
@Ignore
val lon: Double = 0.0,
@Ignore
val timezone: String = "",
@Ignore
@SerializedName("timezone_offset")
val timezoneOffset: Int = 0
) {
@PrimaryKey(autoGenerate = false)
var id: Int = FORECAST_ID
constructor() : this(Current(), listOf(), listOf())
}
could anyone help me please?Ray
12/07/2020, 4:17 PMJorge R
12/15/2020, 10:44 PMMantas Varnagiris
12/18/2020, 7:36 PMRoom
with Paging 3
. I'll explain my setup first so the problem is a bit clearer
• database (android module)
has Room
. It has a Dao
with fun getItems(): PagingSource<Int, ItemEntity>
• ItemEntity
is internal only to database
module - I don't want to use it in domain. It is converted to Item
• core (kotlin module)
has Paging 3
. It wants to do paging using PagingSource<Int, Item>
(not ItemEntity
as it has no knowledge of it)
• database
module implements interface that gives PagingSource<Int, Item>
Now my problem is that I cannot convert from PagingSource<Int, ItemEntity>
to PagingSource<Int, Item>
. At least I could not find a way to do it. I don't want to expose ItemEntity
but I want to do paging with converted model Item
. How can I do that?ebohsen
01/07/2021, 10:32 AMVolatile
property to our RoomDatabase
from where all update operations can request a "timestamp". But I was wondering if this is threadsafe in regards to using Room with suspending functions and transactions? Also not quite sure it actually has to be marked as Volatile
as every access should produce a new java.time.Clock
. Code follows in thread...lewis
02/22/2021, 10:58 AMcompileReleaseJavaWithJavac
it inconsistently (I've not been able to find the trigger to reproduce it yet) fails as the generated Impl class for my Dao contains a method that no longer exists on the Dao (removed many builds ago). I thought this may be due to a build cache issue, but disabling caching does not resolve it, clean build also currently consistent produces the same outcome. Is there anything I can dig/capture to help debug?André Thiele
03/26/2021, 8:16 PMKingKongCoder
04/07/2021, 3:57 PMMini
06/14/2021, 3:28 PMRepeatable annotations with non-SOURCE retention are not yet supported
Im confused, is multiple @DeleteColum not supported? It`s annotated with @RepeatableAndré Thiele
07/26/2021, 4:42 PMShawn Tucker
07/27/2021, 11:22 AMChris Fillmore
08/13/2021, 3:27 PMvalue class
? For example:
@Entity
data class Order(id: OrderId)
@JvmInline
value class OrderId(val value: String)
When I do this, I get an error at build time:
Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
Another error says:
Cannot find getter for field.
I am using Room v2.3.0
Thanks for any help!Marcin Środa
09/03/2021, 1:59 PMdata class Membership(
@PrimaryKey
val id: String,
val channel: String, // channelId
val member: String, // memberId
)
data class Channel(
@PrimaryKey val id: String,
val name: String,
...
)
data class Member(
@PrimaryKey val id: String,
override val name: String,
...
)
Is it possible to create a ChannelWithMembers
and MemberWithChannels
with relations?Mini
09/28/2021, 8:23 AMroom.schemaLocation
annotation processor argument AND set exportSchema to true.”
I have room.schemaLocation like Ive had before, so I guess ksp needs it passed differently. Could someone tell me how?
also getting “Cannot figure out how to save this field into database. You can consider adding a type converter for it.” despite having a typeconverter for the fieldms
09/28/2021, 9:13 AMKhan
10/26/2021, 12:25 PM@Entity
data class Employees(
@PrimaryKey val id: String, val name: String?
)
Thanks 🙂William Reed
10/26/2021, 5:27 PMvalue class
automatically or do i need to manually make a converter?Aidan Low
11/08/2021, 6:53 PM-Xjvm-default=all
and -Xjvm-default=all-compatibility
?
Using version 2.3, if I add either of those flags then when I compile my MyDao.kt
the generated MyDao_Impl.java
for each overriden method foo()
contains calls to MyDao.super.foo()
rather than calling MyDao.DefaultImpls.foo()
as it did when I specified -Xjvm-default=enabled
, leading to compilation errors
error: not an enclosing class: MyDao
return MyDao.super.foo(__cont);
^
Tower Guidev2
11/19/2021, 1:32 PMKV
11/26/2021, 2:24 PMKV
11/26/2021, 2:24 PMyigit
12/02/2021, 5:48 PMmyanmarking
12/06/2021, 10:41 AM