if (readQuery.getQueryResultsCachePolicy() == null) {
readQuery.cacheQueryResults();
}
try {
readQuery.getQueryResultsCachePolicy().setCacheInvalidationPolicy(
new TimeToLiveCacheInvalidationPolicy(Integer.parseInt((String)valueToApply)));
} catch (NumberFormatException exception) {
throw QueryException.queryHintContainedInvalidIntegerValue(QueryHints.QUERY_RESULTS_CACHE_EXPIRY, valueToApply, exception);
}
} else {
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("ejb30-wrong-type-for-query-hint",new Object[]{getQueryId(query), name, getPrintValue(valueToApply)}));