diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2021-05-08 14:58:18 -0600 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2021-05-08 14:58:18 -0600 |
commit | fc908199f136acd2a5030e5085f024857cd2cfb5 (patch) | |
tree | 60e5569fe239bec0c287b69aefd3cff6b95449f7 /app/src/main/java/me/brysonsteck/wiimmfiwatcher/database | |
parent | 1231683daeee4054a9da7204339b9beeb172981e (diff) | |
download | wiimmfi-watcher-fc908199f136acd2a5030e5085f024857cd2cfb5.tar wiimmfi-watcher-fc908199f136acd2a5030e5085f024857cd2cfb5.tar.gz wiimmfi-watcher-fc908199f136acd2a5030e5085f024857cd2cfb5.tar.bz2 |
changed api and package name
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/database')
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/AppDatabase.java | 11 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/FriendCodeDao.java | 30 |
2 files changed, 41 insertions, 0 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/AppDatabase.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/AppDatabase.java new file mode 100644 index 0000000..01884c2 --- /dev/null +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/AppDatabase.java @@ -0,0 +1,11 @@ +package me.brysonsteck.wiimmfiwatcher.database; + +import androidx.room.Database; +import androidx.room.RoomDatabase; + +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; + +@Database(entities = {FriendCode.class}, version=1) +public abstract class AppDatabase extends RoomDatabase { + public abstract FriendCodeDao getFriendCodeDao(); +} diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/FriendCodeDao.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/FriendCodeDao.java new file mode 100644 index 0000000..24e8762 --- /dev/null +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/FriendCodeDao.java @@ -0,0 +1,30 @@ +package me.brysonsteck.wiimmfiwatcher.database; + +import androidx.room.Dao; +import androidx.room.Delete; +import androidx.room.Insert; +import androidx.room.Query; +import androidx.room.Update; + +import java.util.List; + +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; + +@Dao +public interface FriendCodeDao { + + @Query("SELECT * FROM friendcode") + public List<FriendCode> getAll(); + +// @Query("SELECT * FROM friendcodeobj") +// public FriendCodeObj findByCode(String friendCode); + + @Insert + public void insert(FriendCode friendCode); + + @Update + public void update(FriendCode friendCode); + + @Delete + public void delete(FriendCode friendCode); +} |