Questions tagged [android-room-embedded]

7 questions
1
vote
1 answer

How to handle data model with long text column + associated embeded metadata in an Android Room database

I'm new to Android, and rather new to SQL in general. I have a data model where I have a Text that consists of TextMetadata as well as a long string, which is the text content itself. So Text { metadata: { author: string, title: string …
Nathan
  • 73,987
  • 14
  • 40
  • 69
1
vote
0 answers

Android Room: Query returns null in Embedded field

Hi I am using Room DB and inserting a primary key and two embedded fields in a table. While trying to get the data from that table. That embedded fields returning null. Table be like: @NonNull @PrimaryKey @ColumnInfo(name = "ID",…
1
vote
1 answer

Android Room Embedded Field Not Compiling

I am trying to create an embedded field. This is a simple example but I can't get this simple example to work. Eventually I need to have 3 levels of embedded items but trying to get this test case to work. @Entity(tableName =…
JPM
  • 9,077
  • 13
  • 78
  • 137
0
votes
1 answer

use orderBy to get embedded relation-defined table from Android Room

For this transaction Query in Android Room : @Transaction @Query("SELECT * FROM TPAGroup WHERE zuid=:zuid ORDER BY `index`") fun getGroupWithSecretsForZuid(zuid: String): List and this as my data class : data class…
0
votes
1 answer

Android Room embedded relationship query results

I am currently trying to get results from a query of nested relationships in Room. Here Are my classes/database entities involved: @Entity data class PrayerRequestEntity( var title: String, var details: String, var category: String, …
0
votes
2 answers

Deconflict column names in "join" entity

I have 2 entities: @Entity(tableName = "author") data class Author( @PrimaryKey @ColumnInfo(name = "id") val id: String, @ColumnInfo(name = "name") val name: String ) data class Book( @ColumnInfo(name = "id") val id: String, …
0
votes
1 answer

Room database with one-to-one relation like Address, City and State

I looked in the android documentation for an answer to my question, but I couldn't find it. To create a recyclerview using the information contained in these classes, how can I get a list of this information in Room @Entity( foreignKeys = [ …