*
* @return true if this invocation caused the query being registered in the
* cache.
*/
private boolean preExecute(Map params) {
PreparedQueryCache cache = _em.getPreparedQueryCache();
if (cache == null) {
return false;
}
FetchConfiguration fetch = _query.getFetchConfiguration();
Boolean registered = cache.register(_id, _query, fetch);
boolean alreadyCached = (registered == null);
String lang = _query.getLanguage();
QueryStatistics<String> stats = cache.getStatistics();
if (alreadyCached && LANG_PREPARED_SQL.equals(lang)) {
PreparedQuery pq = _em.getPreparedQuery(_id);
if (pq.isInitialized()) {
try {
Map rep = pq.reparametrize(params, _em.getBroker());