Category : android-room

I have a database. How to create a relation in Room so that I can change rows in the "DateWithSteaks" table? I need to change the "IsCompleted" field of "DateWithSteaks" table. Here’s what I did. @Entity public class Steak implements ItemInterfaсe { @PrimaryKey(autoGenerate = true) public int steakId; public boolean dailyCompleted; @TypeConverters(Converters.class) public List<DateTimeConstants> days; ..

Read more

I am trying to insert data into two tables simultaneously while having the primary key from table 1 inserted into table 2. Entity 1: @Entity (tableName = "all_equip") public class EquipInfo implements Comparable <EquipInfo>{ @PrimaryKey (autoGenerate = true) private int equipId; private int gymId; private int userId; private boolean isActive; private String equipGrade; …other Entity ..

Read more

Preface Hey I have a Room entity with a list @Entity(tableName="playlists") Playlist( val playlistId: String, @Ignore val songs:List<Song>) I can retrieve all playlists using junctions and relation PlaylistWithSongs( @Embedded val playlist:Playlist, @Relation( parentColumn = "playlistId", entityColumn = "songId", associateBy = Junction(PlaylistSongCrossRef::class) ) val songs:List<Song>) and my current query @Query("SELECT * FROM playlists") fun getPlaylists():Observable<List<PlaylistWithSongs>> PROBLEM ..

Read more