Created
April 11, 2018 04:08
-
-
Save markchristopherng/5b17c9826e048105e7bf8d31b06d73b8 to your computer and use it in GitHub Desktop.
BranchLocationDao
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package au.com.auspost.android.feature.postcode.service | |
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 au.com.auspost.android.feature.postcode.model.BranchLocation | |
import io.reactivex.Single | |
@Dao | |
interface BranchLocationDao { | |
@Query("SELECT * from branch_location ORDER BY locality ASC") | |
fun getAll() : Single<List<BranchLocation>> | |
@Query("SELECT * from branch_location where postcode like :keyword OR locality like :keyword ORDER BY locality ASC") | |
fun getByKeyword(keyword : String) : Single<List<BranchLocation>> | |
@Insert(onConflict = OnConflictStrategy.REPLACE) | |
fun insert(branchLocation: BranchLocation) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment