DatabaseQuery applyToDatabaseQuery(Object valueToApply, DatabaseQuery query, ClassLoader loader, AbstractSession activeSession) { if (query.isReadQuery()) { ReadQuery readQuery = (ReadQuery)query; if (readQuery.getQueryResultsCachePolicy() == null) { readQuery.cacheQueryResults(); } 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)})); } return query; } }
classDescriptor.setCacheInvalidationPolicy(new DailyCacheInvalidationPolicy(m_expiryTimeOfDay.processHour(), m_expiryTimeOfDay.processMinute(), m_expiryTimeOfDay.processSecond(), m_expiryTimeOfDay.processMillisecond())); } else { throw ValidationException.cacheExpiryAndExpiryTimeOfDayBothSpecified(javaClass);