Last active
July 4, 2018 04:46
-
-
Save markchristopherng/5b0185836278f07a0997009e4db8c3b0 to your computer and use it in GitHub Desktop.
BranchLocationPagingDao
This file contains 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
@Dao | |
interface BranchLocationDao { | |
@Query("SELECT * from branch_location where postcode like :arg0 OR locality like :arg0 ORDER BY locality ASC") | |
fun pageByKeyword(arg0: String): DataSource.Factory<Int, BranchLocation> | |
} |
This file contains 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
@Singleton | |
class BranchLocationManager { | |
@Inject | |
lateinit var db: IBranchLocationManager | |
fun pageByKeyword(keyword: String) = db.branchLocationDao().pageByKeyword(keyword + "%") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment