Questions tagged [android-room-relation]
69 questions
0
votes
1 answer
Android Room subset of values from a junction
I'm trying to extract a subset of values/columns from a junction table as follows
@Entity
class Conversation {
@PrimaryKey
@ColumnInfo(name = "id")
@NonNull
String id = UUID.randomUUID().toString();
}
@Entity
class User {
…

Shadow
- 4,168
- 5
- 41
- 72
0
votes
0 answers
LiveData from Dao trigger onChanged every time when creating Fragment
I found that the LiveData returned by Dao will call its observer whenever my Fragment is created, even when the LiveData value is not changed. I have 2 Entity what have a one-to-one relation like this:
public class PetAndTracker {
@Embedded
public…

developKinberg
- 363
- 4
- 18
0
votes
1 answer
Multiple Tables In Android Room Database
I wonder how to have multiple tables and using relations in the android room database??
I need a little bit of explanation or if you have a good tutorial, I will appreciate
Thanks.

Ahmad Saifaddin
- 1
- 1
- 3
0
votes
1 answer
Creating Relationships between Entities in Room
I am trying to implement searching of places by name in android. I have created two entities, Word and Place.
@Parcelize
@Entity
data class Place(
@PrimaryKey
val id: String,
val name: String,
val icon: String,
val latitude:…

Gilbert
- 2,699
- 28
- 29
0
votes
1 answer
Android ROOM- How can I display data from 3 related entities in a RecyclerView?
Basically, I have 3 related entities which I need to get data from: exercises, exercise_workout_junction and exercise_workout_goals.
I need to display the following in a RecyclerView:
1. exercise_Name (from exercises entity)
2. number_Of_Sets (from…

Josh Brett
- 77
- 3
- 18
0
votes
3 answers
Moshi and room - mapping relationships
I have that Json that I would like to map with Moshi and store with Room
{
"name": "My Group",
"members": [
{
"id": "119075",
"invitedUser": {
"id": 97375,
"email":…

jakub
- 3,576
- 3
- 29
- 55
-1
votes
1 answer
How can I link multiple tables using foreign key in Room database (kotlin)
/*table-1*/
@Entity(tableName = "Doc_Type_Table")
data class DocTypeModel(
@ColumnInfo(name = "title")
var title : String,
@ColumnInfo(name = "date")
var date : String,
@ColumnInfo(name = "color_code")
var colorCode :…

Fahad
- 1
- 2
-2
votes
1 answer
Relation between multiply databases
It is easy to make relation between two tables of a database by @Relation and @ForeignKey of the Room library
And in SQLite we can join tables from different databases
But how can I do it by Room Library?

golkarm
- 1,021
- 1
- 11
- 22