I am upgrading to latest version of phantom-dsl 2.42.0 and scala 2.12 and according to migration guide now I do not require to generate fromRow() method but while querying the database I am getting no implicit parameter found (compile time).
I tried writing fromRow method but still it did'nt work
My case class is -
case class Ball(matchId: Int,
inningsid: Int,
ballNbr: Int,
timeScore: Long,
batStrikerDots: Option[Int],
batStrikerFours: Option[Int],
commFormats: Map[String, CommentaryFormats],
.......
......)
class Ball extends Table[BallData, Ball] with CassandraSession with CommentaryPrimitive {
object matchId extends IntColumn with PartitionKey {
override lazy val name = col_name
}
object inningsId extends IntColumn with PrimaryKey with ClusteringOrder with Descending {
override lazy val name = col_name
}
object ballNbr extends IntColumn with PrimaryKey with ClusteringOrder with Descending {
override lazy val name = col_name
}
object timeScore extends DateTimeColumn with PrimaryKey with ClusteringOrder with Descending {
override lazy val name = col_name
}
object commentaryFormat extends MapColumn[String, CommentaryFormats] {
override lazy val name = "comm_format"
}
............
............
}
col_name are respective column names.
where comm_format is UDT so I have CommentaryPrimitive defined for that which registers a codec on how to deserialize cassandra data to scala case class and CassandaraSession provides implicit keyspace and session.
This is my Primitive code to register the codec -
override def cassandraType: String = {
val format_types = CassandraConnector.getSession.getCluster.getMetadata.getKeyspace("matches_data").getUserType("format_types")
val formatCodecCodec = new CommentaryCodec(TypeCodec.userType(format_types), classOf[CommentaryFormats])
CassandraConnector.registerCodec(formatCodecCodec)
format_types.toString()
}
override def asCql(value: PrimitiveType): String = ???
override def dataType: String = ???
override def serialize(obj: PrimitiveType, protocol: ProtocolVersion): ByteBuffer = ???
override def deserialize(source: ByteBuffer, protocol: ProtocolVersion): PrimitiveType = ???
but while querying I am not able to resolve this-
select.where(_.matchId eqs matchId)(...).one()(...) --> retrieving Ball object
... -> no implicit found
with a new version of phantom-dsl it should automatically resolve Ball data but it is throwing error no implicit found.