Improved nested criteria.
Throw exception if path and query are not set for nested type