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-09-17 00:41:10 +00:00
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
|
|
public void insertTransaction(CryptoCoinTransaction... transactions);
|
2017-09-13 16:12:22 +00:00
|
|
|
}
|