I represented my data model as case classes typing values that may be null as Option.
case class Document(id: Long, title: String, subtitle: Option[String])
That's a pretty dangerous implementation:
scala> val s: String = null s: String = null scala> Document(123, "The Title", s) res2: Document = Document(123,The Title,Some(null))