for (Criterion criterion : criteria.getClauseCriterions()) {
query.append (getQueryWHERE_AND (isWhereSet));
isWhereSet = true;
query.append(criterion.getExpression());
}
OrderCriteria orderCriteria = criteria.getOrderCriteria();
if (criteria.getOrderCriteria()!=null)
query.append(orderCriteria.getExpression());
Query hquery = em.createQuery(query.toString());
if (numberOfResult!=null)
hquery.setMaxResults(numberOfResult);
return hquery.getResultList();
}