LaVOZs

The World’s Largest Online Community for Developers

'; java - With the latest version of phantom(2.42.0) and scala(2.12.0-RC2) No implicit found for parameter ev:Nothing while querying the database - LavOzs.Com

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.

Related
Is there potential starvation in this code or is it just me?
Can I declare a decorator class that extends its own type parameter?
Scala 2.10.0 RC2 and optional parameters
Why won't astyanax (java) recognize my @Id annotated values in my scala case class parameter list?
Database autocreate -> could not find implicit value for parameter session
Spark SQL(v2.0) UDAF in Scala returns empty string
Cassandra Phantom - could not find implicit value for parameter helper: com.outworkers.phantom.macros.TableHelper[Users, User]
Cassandra phantom-dsl derived column is missing in create database generated queries