/** * Gets the criteria. * * @param values the values * @param bean the bean * @return the criteria * @throws ManagerBeanException the manager bean exception * @throws ExpressionException the expression exception */ private Criteria getCriteria(IManagerBean bean, Object[] values) throws ManagerBeanException, ExpressionException { Criteria criteria = null; if (values != null) { criteria = new Criteria(); String prefix = ClassUtils.getShortClassName(bean.getPOJOClass()) + "_"; for (int i = 0; i < values.length; i++) { String fieldName = bean.getFieldName(prefix + getForeignJoinProperties().get(i)); if (values[i] != null) { criteria.addExpression(fieldName, values[i].toString()); } else { criteria.addNullExpression(fieldName); } } } return criteria; }