Skip to content

Instantly share code, notes, and snippets.

@note
Created March 12, 2013 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save note/5146807 to your computer and use it in GitHub Desktop.
Save note/5146807 to your computer and use it in GitHub Desktop.
def findByEmail(email: String): Option[NativeUser] = {
DB.withConnection{ implicit connection =>
SQL("SELECT id, firstName, lastName, email, password, hasAvatar FROM appUser WHERE email={email}").on('email -> email)().collectFirst {
case Row(id: Long, firstName: String, lastName: String, email: String, password: String, hasAvatar: Boolean) => NativeUser(anorm.Id(id), firstName, lastName, email, password, hasAvatar)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment