pellucidanalytics/datomisca — pull request #106 by dwhjames (2014-04-21 16:27:12+00:00)
Title: fix bad interaction of null with value classes

db.entity and db.entid both return null if given a lookup ref that does not resolve.

Constructing the Entity value class from the return value of a method that can return null causes problems. And also, null.asInstanceOf[Long] == 0. This fix tests for nulls and throws exceptions.

To be able to test for lookup ref resolution without needing to trap exceptions, helper methods are added to the lookup ref class that return Option.