Where would be the right place in Lagom to register a Cassandra Codec?

Lagom is managing the connection to the Cassandra database so I don’t know how to register a Cassandra codec.

In my read side, I have a boolean type in my table and when I bind a boolean I got a:

com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [boolean <-> java.lang.String]

@domschoen you can register it in readSide.setPrepare

That was quick, Thanks a lot.

Do you have an example of Boolean Codec registration that could fix my problem ?

I found my way: I’m not setting any codec. I just add a cast to my Boolean as Object.

It is not only compiling but it is working also !

Code before (not compiling):

private def setAdmin(login: String, isAdmin: Boolean) = {
    Future.successful(List(updateUserAdminStatement.bind(isAdmin,login)))
}

Code after (working):

  private def setAdmin(login: String, isAdmin: Boolean) = {
    Future.successful(List(updateUserAdminStatement.bind(isAdmin.asInstanceOf[Object],login)))
  }