I have only limited experience with Anorm since I have jumped on the Slick bandwagon, but I think you distinguish among your cases this way (in order):
- You get an empty collection back.
- You get a
Some
back. - You get a
None
back.
So I would guess you match like this:
myField match {
case Seq() => //the record doesn't exist
case Some(x) => //unpack x because you found something
case None => //the record exists but some_id = NULL
}
Check the Anorm documentation to see what kind of collection you get back. List
does implement the Seq
trait though.