-
Notifications
You must be signed in to change notification settings - Fork 186
Optional primitive columns
Flavian Alexandru edited this page May 30, 2016
·
2 revisions
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 |
To stay up-to-date with our latest releases and news, follow us on Twitter: @outworkers.
- Issues and questions
- Adopters
- Roadmap
- Changelog
- Tutorials
- Commercial support
- Using phantom in your project
- Primitive columns
- Optional primitive columns
- Collection columns
- Collection operators
- Automated schema generation
- Indexing columns
- Data modeling with phantom
- Querying with phantom
- Asynchronous iterators
- Batch statements
- Apache Thrift integration
- Apache ZooKeeper integration
- The phantom testkit