-// Query query = null;
-// if (pattern != null){
-// if (vocs != null && !vocs.isEmpty()){
-// query = session.createQuery("from NamedArea where titleCache like :pattern and vocabulary in :vocs ORDER BY titleCache");
-// query.setParameterList("vocs", vocs);
-// }else{
-// query = session.createQuery("from NamedArea where titleCache like :pattern ORDER BY titleCache");
-// }
-// pattern = pattern.replace("*", "%");
-// pattern = pattern.replace("?", "_");
-// pattern = pattern + "%";
-// query.setParameter("pattern", pattern);
-//
-// } else {
-// query = session.createQuery("FROM NamedArea WHERE vocabulary IN :vocs ORDER BY titleCache");
-// query.setParameterList("vocs", vocs);
-// }
-// if (limit != null && limit > 0){
-// query.setMaxResults(limit);
-// }
-
- Criteria crit = getSession().createCriteria(type, "namedArea");