crystal-wallet-android/app/src/main/java/cy/agorise/crystalwallet/dao/CryptoCurrencyDao.java

29 lines
697 B
Java
Raw Normal View History

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();
@Query("SELECT * FROM crypto_currency WHERE id = :id")
CryptoCurrency getById(int id);
@Insert(onConflict = OnConflictStrategy.REPLACE)
public long[] insertCryptoCurrency(CryptoCurrency... currencies);
}