Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. def getAllUsers: Future[List[User]] = {
  2. select
  3. .fetch()
  4. }
  5.  
  6. def getByid(id: String): Future[Option[String]] = {
  7. select(_.name)
  8. .where(_.id eqs id)
  9. .allowFiltering()
  10. .one()
  11. }
  12.  
  13. def getByQuery(email: String, name: String): Future[Option[(String, Set[String])]] = {
  14. select(_.id, _.email)
  15. .where(_.email contains email)
  16. .and(_.name eqs name)
  17. .allowFiltering()
  18. .one()
  19. }
  20.  
  21. def getByidAndName(id: String): Future[List[User]] = {
  22. update
  23. .where(_.id eqs id)
  24. .modify(_.name setTo "newUser")
  25. .future()
  26. getAllUsers
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement