2017-10-16 00:23:44 +00:00
|
|
|
package cy.agorise.crystalwallet.dao;
|
|
|
|
|
|
|
|
import android.arch.persistence.room.Dao;
|
|
|
|
import android.arch.persistence.room.Insert;
|
|
|
|
import android.arch.persistence.room.OnConflictStrategy;
|
|
|
|
import android.arch.persistence.room.Query;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import cy.agorise.crystalwallet.models.CryptoCurrency;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by henry on 15/10/2017.
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Dao
|
|
|
|
public interface CryptoCurrencyDao {
|
|
|
|
|
|
|
|
@Query("SELECT * FROM crypto_currency")
|
|
|
|
List<CryptoCurrency> getAll();
|
|
|
|
|
2017-10-18 00:35:37 +00:00
|
|
|
@Query("SELECT * FROM crypto_currency WHERE id = :id")
|
2017-10-16 00:23:44 +00:00
|
|
|
CryptoCurrency getById(int id);
|
|
|
|
|
2017-10-26 01:33:38 +00:00
|
|
|
@Query("SELECT * FROM crypto_currency WHERE id IN (:ids)")
|
|
|
|
List<CryptoCurrency> getByIds(List<Long> ids);
|
|
|
|
|
2017-10-24 03:25:09 +00:00
|
|
|
@Query("SELECT * FROM crypto_currency WHERE name = :name")
|
|
|
|
CryptoCurrency getByName(String name);
|
|
|
|
|
2017-10-16 00:23:44 +00:00
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
|
|
public long[] insertCryptoCurrency(CryptoCurrency... currencies);
|
|
|
|
|
|
|
|
}
|