Search in sources :

Example 1 with FilterBean

use of org.akaza.openclinica.bean.extract.FilterBean in project OpenClinica by OpenClinica.

the class FilterDAO 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()) {
        FilterBean fb = (FilterBean) this.getEntityFromHashMap((HashMap) it.next());
        al.add(fb);
    }
    return al;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) FilterBean(org.akaza.openclinica.bean.extract.FilterBean)

Example 2 with FilterBean

use of org.akaza.openclinica.bean.extract.FilterBean in project OpenClinica by OpenClinica.

the class FilterDAO method getEntityFromHashMap.

public Object getEntityFromHashMap(HashMap hm) {
    FilterBean fb = new FilterBean();
    this.setEntityAuditInformation(fb, hm);
    fb.setDescription((String) hm.get("description"));
    fb.setName((String) hm.get("name"));
    fb.setId(((Integer) hm.get("filter_id")).intValue());
    fb.setSQLStatement((String) hm.get("sql_statement"));
    return fb;
}
Also used : FilterBean(org.akaza.openclinica.bean.extract.FilterBean)

Example 3 with FilterBean

use of org.akaza.openclinica.bean.extract.FilterBean in project OpenClinica by OpenClinica.

the class FilterDAO method findByPK.

public EntityBean findByPK(int ID) {
    FilterBean fb = new FilterBean();
    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()) {
        fb = (FilterBean) this.getEntityFromHashMap((HashMap) it.next());
    }
    return fb;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) FilterBean(org.akaza.openclinica.bean.extract.FilterBean)

Example 4 with FilterBean

use of org.akaza.openclinica.bean.extract.FilterBean in project OpenClinica by OpenClinica.

the class FilterDAO method update.

public EntityBean update(EntityBean eb) {
    FilterBean fb = (FilterBean) eb;
    HashMap variables = new HashMap();
    HashMap nullVars = new HashMap();
    variables.put(new Integer(1), fb.getName());
    variables.put(new Integer(2), fb.getDescription());
    variables.put(new Integer(3), new Integer(fb.getStatus().getId()));
    // string, updateid,
    variables.put(new Integer(4), fb.getSQLStatement());
    // filterid
    variables.put(new Integer(5), new Integer(fb.getUpdaterId()));
    variables.put(new Integer(6), new Integer(fb.getId()));
    this.execute(digester.getQuery("update"), variables, nullVars);
    return fb;
}
Also used : HashMap(java.util.HashMap) FilterBean(org.akaza.openclinica.bean.extract.FilterBean)

Example 5 with FilterBean

use of org.akaza.openclinica.bean.extract.FilterBean in project OpenClinica by OpenClinica.

the class FilterDAO method findAllAdmin.

public Collection findAllAdmin() {
    this.setTypesExpected();
    ArrayList alist = this.select(digester.getQuery("findAllAdmin"));
    ArrayList al = new ArrayList();
    Iterator it = alist.iterator();
    while (it.hasNext()) {
        FilterBean fb = (FilterBean) this.getEntityFromHashMap((HashMap) it.next());
        al.add(fb);
    }
    return al;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) FilterBean(org.akaza.openclinica.bean.extract.FilterBean)

Aggregations

FilterBean (org.akaza.openclinica.bean.extract.FilterBean)14 HashMap (java.util.HashMap)10 ArrayList (java.util.ArrayList)7 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)5 EntityBeanTable (org.akaza.openclinica.web.bean.EntityBeanTable)5 Iterator (java.util.Iterator)4 FilterDAO (org.akaza.openclinica.dao.extract.FilterDAO)4 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)3 SimpleDateFormat (java.text.SimpleDateFormat)2 Collection (java.util.Collection)2 LinkedHashMap (java.util.LinkedHashMap)2 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)2 DatasetBean (org.akaza.openclinica.bean.extract.DatasetBean)2 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)2 SectionBean (org.akaza.openclinica.bean.submit.SectionBean)2 Validator (org.akaza.openclinica.control.form.Validator)2 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)2 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)2 Date (java.util.Date)1 Locale (java.util.Locale)1