public QuestionInformationShortVoCollection listQuestion(String text) { StringBuffer hql = new StringBuffer(" from QuestionInformation QI"); DomainFactory factory = getDomainFactory(); if(text != null) { hql.append(" where upper(QI.text) like :qText "); List qInfoList = factory.find(hql.toString(), "qText", ("%" + text + "%")); return QuestionInformationShortVoAssembler.createQuestionInformationShortVoCollectionFromQuestionInformation(qInfoList); } return null; }
public QuestionInformationShortVoCollection listQuestion(QuestionClassification classification) { DomainFactory factory = getDomainFactory(); if(classification != null) { String hql = "select distinct QI from QuestionInformation QI where :classItem in elements(QI.classification)"; List qInfoList = factory.find(hql, "classItem", getDomLookup(classification)); return QuestionInformationShortVoAssembler.createQuestionInformationShortVoCollectionFromQuestionInformation(qInfoList); } return null; }
public QuestionInformationShortVoCollection listQuestion(QuestionClassification classification, String text, PreActiveActiveInactiveStatus status, Boolean isQuestion) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("select distinct QI from QuestionInformation QI "); ArrayList values = new ArrayList(), names = new ArrayList(); boolean firstClause = true; if(isQuestion != null) { hql.append(firstClause?" where ":" and "); hql.append(" isQuestion = :isQuestion"); names.add("isQuestion"); values.add(isQuestion); firstClause = false; } if(text != null) { hql.append(firstClause?" where ":" and "); hql.append(" upper(QI.text) like :qText"); names.add("qText"); values.add("%" + text + "%"); firstClause = false; } if(status != null) { hql.append(firstClause?" where ":" and "); hql.append(" QI.status = :statLkp"); names.add("statLkp"); values.add(getDomLookup(status)); firstClause = false; } if(classification != null) { hql.append(firstClause?" where ":" and "); hql.append(" :classItem in elements(QI.classification)"); names.add("classItem"); values.add(getDomLookup(classification)); firstClause = false; } List qInfoList = factory.find(hql.toString(), names, values); return QuestionInformationShortVoAssembler.createQuestionInformationShortVoCollectionFromQuestionInformation(qInfoList); }