Created
November 8, 2018 11:00
-
-
Save DHosseiny/2320b997f35d98d3880b70c2ebffcb37 to your computer and use it in GitHub Desktop.
Kotlin Extention Functions + Entity Dao
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
package com.izigzag.messenger.model.db | |
import com.izigzag.messenger.model.db.ConversationDao.Properties.Mid | |
import com.izigzag.messenger.model.db.UserDao.Properties.Username | |
fun UserDao.getByUsername(username: String): User = | |
queryBuilder().where(Username.eq(username)).unique() | |
fun MessageDao.getMessage(mid: Long): Message = | |
queryBuilder().where(Mid.eq(mid)).unique() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment