((ObjectLevelReadQuery)query).setCacheUsage(cacheUsage);
if (cacheUsage == ObjectLevelReadQuery.CheckCacheByExactPrimaryKey
|| cacheUsage == ObjectLevelReadQuery.CheckCacheByPrimaryKey
|| cacheUsage == ObjectLevelReadQuery.CheckCacheThenDatabase) {
ReadObjectQuery newQuery = new ReadObjectQuery();
newQuery.copyFromQuery(query);
return newQuery;
}
} else if (query.isModifyAllQuery()) {
int cacheUsage = ((Integer)valueToApply).intValue();
((ModifyAllQuery)query).setCacheUsage(cacheUsage);