]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/dao/ProfileDAO.java
asynchronous profile initialisation
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / dao / ProfileDAO.java
index b4eaf93572bf1b93934526869811fa2ef82ca8d1..52071745c4fc1eb35d620e0c7e8e023bb8f938e0 100644 (file)
@@ -17,6 +17,7 @@
 
 package net.ktnx.mobileledger.dao;
 
+import androidx.lifecycle.LiveData;
 import androidx.room.Dao;
 import androidx.room.Delete;
 import androidx.room.Insert;
@@ -38,4 +39,10 @@ public abstract class ProfileDAO extends BaseDAO<Profile> {
 
     @Query("select * from profiles where id = :profileId")
     public abstract Profile getByIdSync(long profileId);
+
+    @Query("SELECT * FROM profiles WHERE id=:profileId")
+    public abstract LiveData<Profile> getById(long profileId);
+
+    @Query("SELECT * FROM profiles LIMIT 1")
+    public abstract Profile getAnySync();
 }