Updated ROOM

This commit is contained in:
M66B
2021-01-31 18:26:44 +01:00
parent 1a359431c6
commit 70a2af170f
25 changed files with 2850 additions and 76 deletions

View File

@@ -57,7 +57,7 @@
* <pre>
* // File: Song.java
* {@literal @}Entity
* public class User {
* public class Song {
* {@literal @}PrimaryKey
* private int id;
* private String name;
@@ -82,7 +82,7 @@
* // File: MusicDatabase.java
* {@literal @}Database(entities = {Song.java})
* public abstract class MusicDatabase extends RoomDatabase {
* public abstract SongDao userDao();
* public abstract SongDao songDao();
* }
* </pre>
* You can create an instance of {@code MusicDatabase} as follows:
@@ -118,7 +118,7 @@
* String header;
* }
* // DAO
* {@literal @}Query("SELECT id, name || '-' || release_year AS header FROM user")
* {@literal @}Query("SELECT id, name || '-' || release_year AS header FROM song")
* public IdAndSongHeader[] loadSongHeaders();
* </pre>
* If there is a mismatch between the query result and the POJO, Room will print a warning during