@Override
protected void setQueryOption(final Query query, final String name, final Object value) {
if (name.equals(Constants.OPTION_CACHE_MODE)) {
if (value instanceof CacheMode) {
CacheMode cacheMode = (CacheMode) value;
if (cacheMode == CacheMode.ENABLED) {
query.setCacheable(true);
query.setCacheMode(org.hibernate.CacheMode.NORMAL);
}
} else if (value != null) {