Hello,
I wrote a short blog post about how to use jOOQ in H2 stored functions to increase the SQL typesafety thereof:
http://lukaseder.wordpress.com/2011/11/04/use-jooq-inside-your-h2-database/This way, H2 stored functions can be compiled against the actual H2 database schema long before H2 compiles/runs its stored functions. Of course, this approach works also for other libraries, such as JaQu, iciql, QueryDSL, or even JPA CriteriaQuery, whatever the preference is.
Should you think that this is a nice use-case for H2, feel free to use/reference this post from the documentation.
Cheers
Lukas