It would be useful to have immutable versions of jOOQ query objects that do 
not have values bound to bind variables.

Such immutable queries could be reused, and a bind context could be 
supplied whenever the query is run.

Does jOOQ support anything like this?

It would also be useful to be able to introspect on such immutable queries, 
to iterate through the various steps in the query, and to see explicitly 
affected tables, columns, etc. (there could also be implicitly affected 
tables, columns, etc. due to triggers, cascading foreign keys, etc. but 
that's outside the scope of this request), as well as what columns are used 
in included where clauses.

These features would all be especially useful for creating an immutable 
object cache on top of jOOQ supporting efficient cache invalidation, etc.

An immutable query object could be attached to a caching context, in which 
case the caching context could return a wrapped version of the immutable 
query that would first check the cache for that query for the supplied bind 
context whenever it was run, and, if a result set is already present in the 
cache, then it would return an immutable version of that instead of 
performing the query,

Obviously, cache invalidation would have to be performed, and introspection 
of the query to know what columns are used in the where clauses of a query 
would be useful for limiting the extent of cache invalidation (of course, 
this ignores potential issues like a view column being calculated from 
other columns, but, this should still be useful for many common situations, 
and ways of handling the exceptional cases could be devised over time; 
e.g., maybe jOOQ could read comments on view columns which could be used to 
specify the underlying columns on which they depend, or there could be a 
programmatic method / config file for this in jOOQ, etc.).

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to