CriteriaQuery don't support "$type" #647

Resolved the issue with providing $type criteria.