A column map for reading objects from Cassandra.
A column map for reading objects from Cassandra. Describes object's constructor and setters.
A column map for saving objects to Cassandra.
A column map for saving objects to Cassandra. Lists available getters.
Produces ColumnMapForReading or ColumnMapForWriting objects that map
class T
properties to columns in a given Cassandra table.
Produces ColumnMapForReading or ColumnMapForWriting objects that map
class T
properties to columns in a given Cassandra table.
You can associate a custom ColumnMapper
object with any of your classes by
providing an implicit ColumnMapper
in the companion object of the mapped class:
CREATE TABLE kv(key int primary key, value text);
case class KeyValue(k: Int, v: String) object KeyValue { implicit val columnMapper = new DefaultColumnMapper[KeyValue](Map("k" -> "key", "v" -> "value")) }
A ColumnMapper that assumes camel case naming convention for property accessors and constructor names and underscore naming convention for column names.
A ColumnMapper that assumes camel case naming convention for property accessors and constructor names and underscore naming convention for column names.
Example mapping:
case class User( login: String, // mapped to "login" column emailAddress: String // mapped to "email_address" column emailAddress2: String // mapped to "email_address_2" column )
Additionally, it is possible to name columns exactly the same as property names (case-sensitive):
case class TaxPayer( TIN: String // mapped to "TIN" column )
Provides implicit ColumnMapper used for mapping all non-tuple classes.
Provides implicit ColumnMapper objects used for mapping tuples.
Provides machinery for mapping Cassandra tables to user defined Scala classes or tuples. The main class in this package is mapper.ColumnMapper responsible for matching Scala object's properties with Cassandra column names.