Search in sources :

Example 6 with StudyGroupBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) StudyGroupBean(org.akaza.openclinica.bean.managestudy.StudyGroupBean)

Example 7 with StudyGroupBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) StudyGroupBean(org.akaza.openclinica.bean.managestudy.StudyGroupBean)

Example 8 with StudyGroupBean

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;
}
Also used : StudyGroupBean(org.akaza.openclinica.bean.managestudy.StudyGroupBean)

Example 9 with StudyGroupBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) StudyGroupBean(org.akaza.openclinica.bean.managestudy.StudyGroupBean)

Example 10 with StudyGroupBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) StudyGroupBean(org.akaza.openclinica.bean.managestudy.StudyGroupBean)

Aggregations

StudyGroupBean (org.akaza.openclinica.bean.managestudy.StudyGroupBean)26 ArrayList (java.util.ArrayList)22 HashMap (java.util.HashMap)12 Iterator (java.util.Iterator)10 StudyGroupClassBean (org.akaza.openclinica.bean.managestudy.StudyGroupClassBean)10 StudyGroupDAO (org.akaza.openclinica.dao.managestudy.StudyGroupDAO)9 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)6 StudyGroupClassDAO (org.akaza.openclinica.dao.managestudy.StudyGroupClassDAO)6 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)5 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)5 SubjectGroupMapDAO (org.akaza.openclinica.dao.submit.SubjectGroupMapDAO)5 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)4 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)4 SubjectGroupMapBean (org.akaza.openclinica.bean.submit.SubjectGroupMapBean)4 Date (java.util.Date)3 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)3 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)3 DatasetBean (org.akaza.openclinica.bean.extract.DatasetBean)2 StudyUserRoleBean (org.akaza.openclinica.bean.login.StudyUserRoleBean)2 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)2