try {
Time time = Helper.timeFromString((String)valueToApply);
Calendar calendar = Calendar.getInstance();
calendar.setTime(time);
readQuery.getQueryResultsCachePolicy().setCacheInvalidationPolicy(
new DailyCacheInvalidationPolicy(calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND), 0));
} catch (ConversionException exception) {
throw QueryException.queryHintContainedInvalidIntegerValue(QueryHints.QUERY_RESULTS_CACHE_EXPIRY_TIME_OF_DAY, valueToApply, exception);
}
} else {
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("ejb30-wrong-type-for-query-hint",new Object[]{getQueryId(query), name, getPrintValue(valueToApply)}));