I am new to Squeryl and trying to figure out how to cast the results I get back from a query into case class. I have something like this
def getUsers = {
val data = getUserData
...
}
def getUserData = {
transaction {
from(users)(s =>
select(s.id, s.firstName, s.lastName, s.userName, s.email, s.lastLoginDate, s.dateJoined)
)
}
}
case class UserData(userId: Long, firstName: String, lastName: String, userName: String, email: String, lastLoginDate: Timestamp, dateJoined: Timestamp)
case class UserDataRecords(users: List[UserData])
Ideally, I would like to get the data back in the from of UserDataRecords. Right now it is returned as Query[Tuple7]. Such as
...
(5,Suzie,Queue,squeue,SQueue@example.com,2014-01-15 22:02:12.0,2014-01-15 22:02:12.0)
...
What I cant figure out is how to cast this data. Any help on this would be great!