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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations