Questions tagged [android-room]

For questions related to Android Room Persistence Library (which is a part of Android Architecture Components)

Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.

6786 questions
2
votes
1 answer

How can I save a List in an Entity?

im saving an entity that looks like this @Entity data class Entity( @PrimaryKey val id: Int, val productPresentationList: List, val supplierComparePriceList: List ) And, when I run the app i got this error…
Nicote Ool
  • 121
  • 8
2
votes
1 answer

Android Room - selective query with LiveData

Is it possible to get specific rows from Room with LiveData? My goal is to retrieve certain items from data base, when each item is conditioned by to columns ("page" and "category"). The problem is that in LiveData observer I always receive the same…
2
votes
1 answer

Room Android ignores @Query conditions in Dao class (Strange)

I am posting this because same issue is already there on stackoverflow but no solution on this. I am using Room library for db operations. I have created data classes with @Embedded and @Relation with other tables. Now the issue is when I put join…
TechHelper
  • 822
  • 10
  • 24
2
votes
0 answers

java.lang.RuntimeException: cannot find implementation for .IngredientDatabase. IngredientDatabase_Impl does not exist

I am trying to interact with my application but am encountering the error in the title. I have followed the answer on: Kotlin Execution failed for task ':app:kaptDebugKotlin' in using annotationProcessor instead of kapt to get rid of the…
Gil Ong
  • 67
  • 1
  • 6
2
votes
1 answer

Adding second Room database to my app causes exception: " Caused by: java.lang.IllegalStateException: Room cannot verify the data integrity"

I am creating a pixel art editor app and I already have one Room database which stores the users' creations and another Room database which I want to add which will store some custom color palettes the user wants to add to the app. To do this I…
thebluepandabear
  • 263
  • 2
  • 7
  • 29
2
votes
1 answer

Met "error: Multiple fields have the same columnName" when building Android AOSP

I met an error when encountering Android Room. I use the following 3 classes to illustrate. Class A and B are 2 entity classes in an Android app. Class C is a modified class in the Android framework (more specifically, it is a class in the core Java…
Richard Hu
  • 811
  • 5
  • 18
2
votes
1 answer

How to search by date Room Database?

I have a database in room database Android Studio in which I need to find the records that match a date that comes to me through an http query The problem I see is that since I am using a data converter (ZoneDateTimeConverter) when trying to make…
2
votes
1 answer

Abstract database methods must return a @Dao annotated class or interface

I think this topic already existed. But, since we have a new version of room database, it will be helpful to me to understand better. So, I am implementing a room database with the version 2.3.0 but I am getting lot of errors: Type of the parameter…
kamdaou
  • 97
  • 1
  • 8
2
votes
1 answer

Room insert into one-to-many relationship

When trying to use intermediary classes to model entity relationships in Room, I have run into an issue. Whilst documentation describes how to get from a one-to-many relationship, it does not describe how to insert. I'm assuming this cannot be done…
Jr795
  • 691
  • 1
  • 8
  • 15
2
votes
4 answers

Room error: Type of the parameter must be a class annotated with @Entity or a collection/array of it. even after adding androidx.room:room-ktx

According to what i understood its due to "suspend" keyword. But I have already added implementation("androidx.room:room-ktx:$roomVersion") dependency Gradle file is: plugins { id 'com.android.application' id 'kotlin-android' …
2
votes
1 answer

Nested embedded lists on Room

Using room I'm trying to have an object of type Something, that contains a list of Stuff, and each item of that list contains another list of Things. data class rootWrapper( @Embeded var somethingEntity: SomethingEntity …
Leonardo Velozo
  • 598
  • 1
  • 6
  • 16
2
votes
1 answer

Room unexcepted error. Error: Not sure how to handle query method's return type

error: Not sure how to handle query method's return type Unexcepter error in DbDao class after rebuild project. Until that point, everything worked great and nothing was done in that class or anything that had anything to do with that library, but…
2
votes
1 answer

Primary and foreign key implementation Java and Android Room

This is my first time asking a question here in StackOverflow so forgive me if I am not asking the question right or a certain way. I have two child classes (PerformanceAssessment and ObjectiveAssessment) from parent class Assessment. I was able to…
JayM
  • 61
  • 8
2
votes
2 answers

Error: Type of the parameter must be a class annotated with @Entity or a collection/array

I know that some have already posted this topic but after reviewed all the given answer, I can not find anything suit my case. I would be happy if someone can help me resolving my case. I started getting my build failed as I've updated my Kotlin lib…
K. Donon
  • 254
  • 2
  • 13
2
votes
1 answer

Room with prepopulated database

In my app I'm using Room with a prepopulated database myDatabase.db which is then accessed using this code: private val database = Room .databaseBuilder(context.applicationContext, AppDatabase::class.java, dbName) …