Hi Max,
We ran into a strange gotcha with custom types. With e.g. Joda's LocalDate and an entity class like
class Foo(..., bar: Option[LocalDate])
where(f.bar === new LocalDate) works fine, but where(f.bar === Some(new LocalDate)) compiles fine, but then throws an exception at runtime. It looks like the problem is that ConstantTypedExpression is getting the unwrapped Option[LocalDate] as its nativeJdbcValue (which in turn is just what DeOptionizer#convertToJdbc does). The JDBC driver then throws an exception when #setObject(...) gets the LocalDate.
Needless to say the former where(...) is better style, but it seems like the latter should work too. I thought fixing this would mean delegating to deOptionizer like most of the rest of DeOptionizer does, but I'm getting all tangled up in the type parameters involved so I'm appealing to a higher power. ;-)