2017-09-13 16:12:22 +00:00
|
|
|
package cy.agorise.crystalwallet.dao;
|
|
|
|
|
|
|
|
import android.arch.lifecycle.LiveData;
|
2017-09-18 02:38:05 +00:00
|
|
|
import android.arch.paging.LivePagedListProvider;
|
2017-09-13 16:12:22 +00:00
|
|
|
import android.arch.persistence.room.Dao;
|
2017-09-17 00:41:10 +00:00
|
|
|
import android.arch.persistence.room.Insert;
|
|
|
|
import android.arch.persistence.room.OnConflictStrategy;
|
2017-09-13 16:12:22 +00:00
|
|
|
import android.arch.persistence.room.Query;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import cy.agorise.crystalwallet.models.CryptoCoinTransaction;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by Henry Varona on 12/9/2017.
|
|
|
|
*/
|
|
|
|
@Dao
|
|
|
|
public interface TransactionDao {
|
|
|
|
|
|
|
|
@Query("SELECT * FROM crypto_coin_transaction")
|
|
|
|
LiveData<List<CryptoCoinTransaction>> getAll();
|
2017-09-17 00:41:10 +00:00
|
|
|
|
2017-09-18 02:38:05 +00:00
|
|
|
@Query("SELECT * FROM crypto_coin_transaction ORDER BY date ASC")
|
|
|
|
LivePagedListProvider<Integer, CryptoCoinTransaction> transactionsByDate();
|
|
|
|
|
2017-10-18 00:35:37 +00:00
|
|
|
@Query("SELECT * FROM crypto_coin_transaction WHERE account_id = :idAccount ORDER BY date ASC")
|
2017-10-23 01:00:51 +00:00
|
|
|
LiveData<List<CryptoCoinTransaction>> getByIdAccountLiveData(long idAccount);
|
|
|
|
|
|
|
|
@Query("SELECT * FROM crypto_coin_transaction WHERE account_id = :idAccount ORDER BY date ASC")
|
|
|
|
List<CryptoCoinTransaction> getByIdAccount(long idAccount);
|
2017-10-16 00:23:44 +00:00
|
|
|
|
2017-09-17 00:41:10 +00:00
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
2017-09-27 02:24:23 +00:00
|
|
|
public long[] insertTransaction(CryptoCoinTransaction... transactions);
|
2017-09-20 01:59:14 +00:00
|
|
|
|
|
|
|
@Query("DELETE FROM crypto_coin_transaction")
|
|
|
|
public void deleteAllTransactions();
|
2017-09-13 16:12:22 +00:00
|
|
|
}
|