Package

com.datastax.spark.connector

mapper

Permalink

package mapper

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. mapper
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait ColumnMapForReading extends Serializable

    Permalink

    A column map for reading objects from Cassandra.

    A column map for reading objects from Cassandra. Describes object's constructor and setters.

  2. trait ColumnMapForWriting extends Serializable

    Permalink

    A column map for saving objects to Cassandra.

    A column map for saving objects to Cassandra. Lists available getters.

  3. trait ColumnMapper[T] extends AnyRef

    Permalink

    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"))
    }
  4. class DataFrameColumnMapper[T] extends ColumnMapper[T]

    Permalink
  5. class DefaultColumnMapper[T] extends ColumnMapper[T]

    Permalink

    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
    )
  6. class JavaBeanColumnMapper[T] extends ReflectionColumnMapper[T]

    Permalink
  7. trait LowPriorityColumnMapper extends AnyRef

    Permalink

    Provides implicit ColumnMapper used for mapping all non-tuple classes.

  8. abstract class ReflectionColumnMapper[T] extends ColumnMapper[T]

    Permalink
  9. case class SimpleColumnMapForReading(constructor: Seq[ColumnRef], setters: Map[String, ColumnRef], allowsNull: Boolean = false) extends ColumnMapForReading with Product with Serializable

    Permalink
  10. case class SimpleColumnMapForWriting(getters: Map[String, ColumnRef]) extends ColumnMapForWriting with Product with Serializable

    Permalink
  11. class TupleColumnMapper[T] extends ColumnMapper[T]

    Permalink

Value Members

  1. object ColumnMapper extends LowPriorityColumnMapper

    Permalink

    Provides implicit ColumnMapper objects used for mapping tuples.

  2. object ColumnMapperConvention

    Permalink
  3. object DefaultColumnMapper

    Permalink
  4. object JavaBeanColumnMapper

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped