resolves #1809: converted query from HQL to criteria