Skip to content

Optional primitive columns

Flavian Alexandru edited this page May 30, 2016 · 2 revisions

Build Status Coverage Status Maven Central Bintray

Optional columns allow you to set a column to a null or a None. Use them when you really want something to be optional. The outcome is that instead of a T you get an Option[T] and you can match, fold, flatMap, map on a None.

The Optional part is handled at a DSL level, it's not translated to Cassandra in any way.

phantom columns Java/Scala type Cassandra columns
OptionalBlobColumn Option[java.nio.ByteBuffer] blog
OptionalBigDecimalColumn Option[scala.math.BigDecimal] decimal
OptionalBigIntColumn Option[scala.math.BigInt] varint
OptionalBooleanColumn Option[scala.Boolean] boolean
OptionalDateColumn Option[java.util.Date] timestamp
OptionalDateTimeColumn Option[org.joda.time.DateTime] timestamp
OptionalDoubleColumn Option[scala.Double] double
OptionalEnumColumn Option[scala.Enumeration] text
OptionalFloatColumn Option[scala.Float] float
OptionalIntColumn Option[scala.Int] int
OptionalInetAddressColumn Option[java.net.InetAddress] inet
OptionalLongColumn Option[Long] long
OptionalStringColumn Option[java.lang.String] text
OptionalUUIDColumn Option[java.util.UUID] uuid
OptionalTimeUUID Option[java.util.UUID] timeuuid