Hi, folks!
I'm newbie in Scala world and I'm developing an application using Play Framework and Cassandra. For access the Cassandra I use the Datastax Java driver.
In my application I have the following class. This class, like you can see in the snippet, is a mapped Cassandra column family.
@Table(keyspace="gathering", name="raw")
class Raw(@PartitionKey @Column(name="creation_id") creationId: Int, @ClusteringColumn @Column(name="input_id") inputId: java.util.UUID,
@Column(name="data") data: String)
And the following code is where I try to save some obj in the database
def save(obj: AnyRef) = {
mappingManager.mapper(obj.getClass).save(obj)
}
And when I compile the source code I can see these errors:
[error] /path/to/file/Cassandra.scala:67: type mismatch;
[error] found : obj.type (with underlying type AnyRef)
[error] required: ?0 where type ?0 <: AnyRef
[error] mappingManager.mapper(obj.getClass).save(obj)
Somebody can help me to solve these problem? I guess is something wrong with using Java generics within Scala
The javadoc of the MappingManager and Mapper used can be found
hereThank you