fix query_cache behavior compatibility with Criteria and ModelCriteria