Wow, it's even more complicated:
http://www.eclipse.org/eclipselink/api/2.2/org/eclipse/persistence/config/QueryHints.html#QUERY_RESULTS_CACHE
says, bafflingly:
Configures the query to use a results
cache. By default the query will cache 100 query results,
such that the same named query with the same arguments is
re-executed it will skip the database and just return the
cached results.
That part isn't baffling--that sounds like exactly what I
want! But then it goes on to say:
Valid values are: HintValues.PERSISTENCE_UNIT_DEFAULT,
HintValues.TRUE, HintValues.FALSE, "" could be used instead
of default value HintValues.PERSISTENCE_UNIT_DEFAULT. By
default query results are not cached. This is not, and is
independent from the object cache.
(This is not...what?) What
is the default? Is it
FALSE, or PERSISTENCE_UNIT_DEFAULT? If this is the way to
handle this use case, why is it not mentioned here:
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#How_to_Use_EclipseLink_JPA_Query_Hints?
Does this mean that I cannot use
eclipselink.query-results-cache as a JPA query hint? If I
can, then why isn't it in the list of valid JPA query hints?
Benevolently confused,
Laird