AppCompatActivity(), CoroutineScope { val job = Job() override val coroutineContext: CoroutineContext get() = Dispatchers.Main + job public interface CoroutineScope { public val coroutineContext: CoroutineContext }
{ @Insert suspend fun insert(user: User) @Update suspend fun update(user: User) @Query("SELECT * FROM user") suspend fun getAllUsers(): List<User> @Delete suspend fun delete(user: User) }
ɺϥΠϒϥϦͱ ͯܰ͠ྔ w $PSPVUJOF4DPQFͱϥΠϑαΠΫϧΛ࣋ͭίϯϙʔωϯτΛ Έ߹Θͤͯ͏ w ୯७ͳඇಉظॲཧXJUI$POUFYUؔͰେΧόʔͰ͖Δ w ฒྻͰίϧʔνϯΛىಈ͢Δ߹είʔϓͷ֊Λҙࣝ͢Δඞ ཁ͕͋Δɻ w 3Yͱରཱ͠ͳ͍ɻҰ෦ͷॲཧ͕ஔ͖͕͑Ͱ͖Δ͔ w +FUQBDLͰଓʑαϙʔτ͕ਐΜͰಋೖ͘͢͠ͳ͖͍ͬͯͯΔ