Skip to content

Instantly share code, notes, and snippets.

@DHosseiny
Created November 8, 2018 11:00
Show Gist options
  • Save DHosseiny/2320b997f35d98d3880b70c2ebffcb37 to your computer and use it in GitHub Desktop.
Save DHosseiny/2320b997f35d98d3880b70c2ebffcb37 to your computer and use it in GitHub Desktop.
Kotlin Extention Functions + Entity Dao
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