I am a beginner making use of a Roomdatabase. Mostly using it to load in and pass items between tables using simple relationships. For some reason it isn’t properly adding the selected item from the recyclerView adapter to the selectedItem variable. Would appreciate any insight into why this is happening all of a sudden. Answer It turned out that the
Tag: kotlin
Updating webclient response from database
I have situation where I can’t update column at database. The problem is that only method setIsPurchased is executed and the flag is_purchase at SQL table changed to true, but the next line with setPurchasedDate which has to set current time is not executed. The response from database is Mono<Void> type. Queries for those two method are simple and looks
Write query with HAVING clause in Kotlin with Exposed
I have written an SQL query in which I use the HAVING clause. However, I have not found practical examples of the use of HAVING in the Exhibited documentation. My query should return the following: Disputes for an order that has the most recent status of ‘CAPTURED’ or ‘EXPIRED’ My biggest difficulty is writing the HAVING sub query. I saw
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
Correct value of a json data saved using JPA, spring and kotlin Map
I have a jsonb column in a postgres database where I store a bunch of key/value(1 level) into a column mappped to a a Map<String, Any). The values are supposed to be a String but in code I’m accepting anything. All saved values was passed as ByteArray(byte[]) and it’s stored without problems. The stored value is transformed to a String
Compilation throws `None of the following functions can be called with the arguments supplied`
Trying to implement a custom JSONB binding that maps to an object containing a map. Generated code throws a None of the following functions can be called with the arguments supplied error caused by the following line: Here’s my configuration: Also, it seems like the line causing problems is mapping database data to JOOQ’s default JSONB object. Is that what’s
How to access a local, pre-populated sqlite database using Kotlin in Android Studio?
For a personal project, I am creating a quiz app written in Kotlin. To store information about a given question (four choices, the question itself, a category, and the correct answer), I have created a database using SQLite that stores said information. However, I am not unsure of a couple of things. One is where do I put my prepopulated
Problems with insertions after adding new tables to database
UPDATE: override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) { if (oldVersion < 3) { db?.execSQL(ARTIGO_TABLE_NAME); } if (oldVersion < 3) { ...