blob: df763c935f7a7b431fd156faf9010e4f10f7447f (
plain) (
tree)
|
|
package SubredditDatabase;
import android.arch.lifecycle.LiveData;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
@Dao
public interface SubredditDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insert(SubredditData SubredditData);
@Query("DELETE FROM subreddits")
void deleteAllSubreddits();
@Query("SELECT * from subreddits WHERE name = :namePrefixed LIMIT 1")
LiveData<SubredditData> getSubredditLiveDataByName(String namePrefixed);
@Query("SELECT * from subreddits WHERE name = :namePrefixed LIMIT 1")
SubredditData getSubredditData(String namePrefixed);
}
|