I have a case class like this:
case class Address(id String, location String)
case class Person(id String, name String, address Option[Address])
Now I want to store these case class in cassandra table. I am working with Lagom Persistence. So I created Read side Processor to do that task. I wrote the following under setGlobalPrepare method:
session.executeWrite("""
| CREATE TYPE Address(
| id text,
| location text)""".stripMargin)
session.executeCreateTable("""
| CREATE TABLE Person(
| id text,
| name text,
| address frozen<Address>,
| PRIMARY KEY((id),name)
| )""".stripMargin)
But this showing an error that "UnresolvedUserTypeException: cannot resolve user type testdatabase.id" (testdatabase is the keyspace)and same for name of Address UDT.
First i Thought it was because of all the execution of the command are running in future so I tried using map to wait for the main table to be created before the UDT but didnt work. All tables are showing in cassandra but i am getting this error and i am not able to insert anything to it.
Need Help....