Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AccountDao.java « dao « db « adapters « sync « persistence « deck « nextcloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 56ac92008c8b081a49ad943a1d17038e97692964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Query;

import java.util.List;

import it.niedermann.nextcloud.deck.model.Account;

@Dao
public interface AccountDao extends GenericDao<Account> {

    @Query("SELECT * FROM account")
    LiveData<List<Account>> getAccounts();

    @Query("SELECT count(*) FROM account")
    int countAccountsDirectly();

    @Query("SELECT count(*) FROM account")
    LiveData<Integer> countAccounts();

    @Query("DELETE from account where id = :id")
    void deleteById(long id);

    @Query("SELECT * from account where id = :id")
    Account getAccountByIdDirectly(long id);

    @Query("SELECT * from account where id = :id")
    LiveData<Account> selectById(long id);

    @Query("SELECT * from account where name = :name")
    LiveData<Account> selectById(String name);

    @Query("SELECT * from account")
    LiveData<List<Account>> selectAll();
}