Skip to content
Advertisement

Tag: android

Android Room database – Delete rows after row limit?

I’m trying to delete any inactive rows after a limit of 1000 rows, and I’ve tried this: but it’s deleting everything from the table. EDIT: I’ve tried this, but it’s deleting all inactive orders: I want to keep the first 1000 inactive orders and delete the remaining older inactive orders. I would also like to keep all active orders. Answer

Android Room Query returning null

I am trying to get the values from a DB via Room but it always returns null. It should retrieve the data from DB BalancesCat. Any help? Thanks! This is the DAO Repository ViewModel and the Fragment where I want to retrieve the data Answer This isn’t your problem, but I have to mention, your repository’s getAllBalancesCat() function is needlessly

How to receive not duplicative rows using Room?

I have two related entities: Station Connector When I insert data, I fill up both entites and it seems kinda okay, but when I’m trying to receive stations with particular types of connectors it duplicates rows. For example, I have an object And if I want to filter stations only by one connector type I receive one row with this

Advertisement