Alias

4 views
Skip to first unread message

Truong Tho Nguyen

unread,
May 18, 2013, 5:15:49 PM5/18/13
to rogue...@googlegroups.com
Can I do something similar to this:

case class User (displayName: String)
UserRecord where (_.id eqs 1).selectCase(_.firstName + " " + _.lastName, User)

Thanks

Jason Liszka

unread,
May 19, 2013, 6:02:34 PM5/19/13
to rogue...@googlegroups.com
No, the functions you provide to selectCase must be fields on the UserRecord class. You could do this instead:

case class User (firstName: String, lastName: String) = {
  val displayName = firstName + " " + lastName
}
UserRecord where (_.id eqs 1).selectCase(_.firstName, _.lastName, User)


--
You received this message because you are subscribed to the Google Groups "rogue-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rogue-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages