]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/dao/ProfileDAO.java
more Room adoption - accounts@100%, some profiles/transactions
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / dao / ProfileDAO.java
index ac51ecc2bf53ec019902f733b9f12584706038e3..b4eaf93572bf1b93934526869811fa2ef82ca8d1 100644 (file)
 package net.ktnx.mobileledger.dao;
 
 import androidx.room.Dao;
+import androidx.room.Delete;
+import androidx.room.Insert;
+import androidx.room.Query;
+import androidx.room.Update;
 
 import net.ktnx.mobileledger.db.Profile;
 
 @Dao
-abstract class ProfileDAO extends BaseDAO<Profile> {
-    @Override
+public abstract class ProfileDAO extends BaseDAO<Profile> {
+    @Insert
     abstract long insertSync(Profile item);
 
-    @Override
+    @Update
     abstract void updateSync(Profile item);
 
-    @Override
-    abstract void deleteSync(Profile item);
+    @Delete
+    public abstract void deleteSync(Profile item);
+
+    @Query("select * from profiles where id = :profileId")
+    public abstract Profile getByIdSync(long profileId);
 }