This is all occurring within a Play 2.3.x app w/ scala template
I am using this import:
import com.datastax.driver.core.Row
Along with this case class
case class timeOnPage(ip: String, pages: Map[String, Long])
I am using the following code to generate instances of timeOnPage with cassandra rows:
private def times(row: Row): timeOnPage =
timeOnPage(row.getString("ip"), row.getMap("page", classOf[String], classOf[Long]).toMap)
The code compiles fine, but when it is run, this error is returned:
[InvalidTypeException: Column page is a map of class java.lang.String->class java.lang.Long (CQL type map<varchar, bigint>), cannot be retrieve as a map of class java.lang.String->long]
I've tried a few different ways of declaring classOf[Long] like:
classOf[java.lang.Long]
Class.forName("java.lang.Long")
Neither type checks.
Any insight on this? Thank you in advance