public CategoryQuestionShortVoCollection listCategoryQuestions(ims.ocrr.vo.lookups.CategoryCollection categories) { if (categories == null || categories.size() == 0) return null; StringBuffer hql = new StringBuffer(); hql.append("from CategoryQuestion as c1_1 where"); hql.append(" c1_1.oCRRCategory.id in ("); for (int i = 0; i < categories.size(); i++) { hql.append(categories.get(i).getID()); if (i < (categories.size() - 1)) hql.append(", "); } hql.append(") order by systemInformation.creationDateTime"); List list = getDomainFactory().find(hql.toString()); return CategoryQuestionShortVoAssembler.createCategoryQuestionShortVoCollectionFromCategoryQuestion(list); }
/** * listCategoryQuestions */ public CategoryQuestionShortVoCollection listCategoryQuestions(ims.ocrr.vo.lookups.Category category) { if(category == null) throw new CodingRuntimeException("category parameter is null - listCategoryQuestions"); List list = getDomainFactory().find("from CategoryQuestion cat where cat.oCRRCategory = :category order by systemInformation.creationDateTime", new String[]{"category"}, new Object[]{getDomLookup(category)}); return CategoryQuestionShortVoAssembler.createCategoryQuestionShortVoCollectionFromCategoryQuestion(list); }