use of org.akaza.openclinica.bean.managestudy.StudyGroupBean in project OpenClinica by OpenClinica.
the class StudyGroupDAO method findByNameAndGroupClassID.
public StudyGroupBean findByNameAndGroupClassID(String name, int studyGroupClassId) {
StudyGroupBean eb = new StudyGroupBean();
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), name);
variables.put(new Integer(2), new Integer(studyGroupClassId));
String sql = digester.getQuery("findByNameAndGroupClassId");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
if (it.hasNext()) {
eb = (StudyGroupBean) this.getEntityFromHashMap((HashMap) it.next());
}
return eb;
}
use of org.akaza.openclinica.bean.managestudy.StudyGroupBean in project OpenClinica by OpenClinica.
the class StudyGroupDAO method getGroupByStudySubject.
public ArrayList getGroupByStudySubject(int studySubjectId, int studyId, int parentStudyId) {
ArrayList answer = new ArrayList();
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(1, studySubjectId);
variables.put(2, studyId);
variables.put(3, parentStudyId);
ArrayList alist = this.select(digester.getQuery("getGroupByStudySubject"), variables);
Iterator it = alist.iterator();
while (it.hasNext()) {
HashMap hm = (HashMap) it.next();
StudyGroupBean g = (StudyGroupBean) this.getEntityFromHashMap(hm);
answer.add(g);
}
return answer;
}
use of org.akaza.openclinica.bean.managestudy.StudyGroupBean in project OpenClinica by OpenClinica.
the class StudyGroupDAO method getEntityFromHashMap.
/**
* <p>
* getEntityFromHashMap, the method that gets the object from the database
* query.
*/
public Object getEntityFromHashMap(HashMap hm) {
StudyGroupBean eb = new StudyGroupBean();
eb.setId(((Integer) hm.get("study_group_id")).intValue());
eb.setName((String) hm.get("name"));
eb.setDescription((String) hm.get("description"));
eb.setStudyGroupClassId(((Integer) hm.get("study_group_class_id")).intValue());
return eb;
}
use of org.akaza.openclinica.bean.managestudy.StudyGroupBean in project OpenClinica by OpenClinica.
the class StudyGroupDAO method findAll.
public Collection findAll() {
this.setTypesExpected();
ArrayList alist = this.select(digester.getQuery("findAll"));
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
StudyGroupBean eb = (StudyGroupBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.StudyGroupBean in project OpenClinica by OpenClinica.
the class StudyGroupDAO method findByPK.
public EntityBean findByPK(int id) {
StudyGroupBean eb = new StudyGroupBean();
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(id));
String sql = digester.getQuery("findByPK");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
if (it.hasNext()) {
eb = (StudyGroupBean) this.getEntityFromHashMap((HashMap) it.next());
}
return eb;
}
Aggregations