Introduce utility class org.simantics.db.function.DbOptional<T>.
The class is a direct copy of java.util.Optional<T> but it uses
DbConsumer, DbFunction, DbPredicate and DbSupplier instead of the
standard Java 1.8 functional interfaces to allow the DbOptional methods
to throw DatabaseExceptions for cleaner database code in certain
situations.
The rationale behind this class is much the same as with the standard
optional. See e.g.
http://www.oracle.com/technetwork/articles/java/java8-optional-
2175753.html.
refs #6829
Change-Id: Ibf62a56eb227264cbfac359aca99d87570b68a47