/** * Gets the detail list. Used in the reports * * @return the detail list */ @Transient public List getDetailList() { try { IManagerBean offerDetailBean = BeanManager.getManagerBean(OfferDetail.class); Criteria criteria = new Criteria(); criteria.addEqualExpression( offerDetailBean.getFieldName(ICommercialAlias.OFFER_DETAIL_OFFER_ID), getId()); return offerDetailBean.getList(criteria); } catch (ManagerBeanException e) { LOGGER.log(Level.SEVERE, "Error obtaining offerDetail list", e); } return null; }
/** * 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; }