use of org.akaza.openclinica.bean.extract.ArchivedDatasetFileBean in project OpenClinica by OpenClinica.
the class ArchivedDatasetFileDAO method create.
public EntityBean create(EntityBean eb) {
ArchivedDatasetFileBean fb = (ArchivedDatasetFileBean) eb;
HashMap variables = new HashMap();
HashMap nullVars = new HashMap();
variables.put(Integer.valueOf(1), fb.getName());
variables.put(Integer.valueOf(2), Integer.valueOf(fb.getDatasetId()));
variables.put(Integer.valueOf(3), Integer.valueOf(fb.getExportFormatId()));
variables.put(Integer.valueOf(4), fb.getFileReference());
variables.put(Integer.valueOf(5), Integer.valueOf(fb.getFileSize()));
variables.put(Integer.valueOf(6), new Double(fb.getRunTime()));
variables.put(Integer.valueOf(7), Integer.valueOf(fb.getOwnerId()));
this.executeWithPK(digester.getQuery("create"), variables, nullVars);
if (isQuerySuccessful()) {
fb.setId(getLatestPK());
}
return fb;
}
use of org.akaza.openclinica.bean.extract.ArchivedDatasetFileBean in project OpenClinica by OpenClinica.
the class ArchivedDatasetFileDAO 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()) {
ArchivedDatasetFileBean fb = (ArchivedDatasetFileBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(fb);
}
return al;
}
use of org.akaza.openclinica.bean.extract.ArchivedDatasetFileBean in project OpenClinica by OpenClinica.
the class ArchivedDatasetFileDAO method update.
public EntityBean update(EntityBean eb) {
ArchivedDatasetFileBean fb = (ArchivedDatasetFileBean) eb;
HashMap variables = new HashMap();
HashMap nullVars = new HashMap();
variables.put(Integer.valueOf(1), fb.getName());
variables.put(Integer.valueOf(2), Integer.valueOf(fb.getDatasetId()));
variables.put(Integer.valueOf(3), Integer.valueOf(fb.getExportFormatId()));
variables.put(Integer.valueOf(4), fb.getFileReference());
variables.put(Integer.valueOf(5), Integer.valueOf(fb.getFileSize()));
variables.put(Integer.valueOf(6), new Double(fb.getRunTime()));
variables.put(Integer.valueOf(7), Integer.valueOf(fb.getOwnerId()));
variables.put(Integer.valueOf(8), Integer.valueOf(fb.getId()));
this.execute(digester.getQuery("update"), variables, nullVars);
return fb;
}
use of org.akaza.openclinica.bean.extract.ArchivedDatasetFileBean in project OpenClinica by OpenClinica.
the class ArchivedDatasetFileDAO method getEntityFromHashMap.
public Object getEntityFromHashMap(HashMap hm) {
ArchivedDatasetFileBean fb = new ArchivedDatasetFileBean();
fb.setId(((Integer) hm.get("archived_dataset_file_id")).intValue());
fb.setDateCreated((Date) hm.get("date_created"));
fb.setName((String) hm.get("name"));
fb.setId(((Integer) hm.get("archived_dataset_file_id")).intValue());
fb.setDatasetId(((Integer) hm.get("dataset_id")).intValue());
fb.setExportFormatId(((Integer) hm.get("export_format_id")).intValue());
fb.setFileReference((String) hm.get("file_reference"));
fb.setRunTime(((Integer) hm.get("run_time")).doubleValue());
fb.setFileSize(((Integer) hm.get("file_size")).intValue());
fb.setOwnerId(((Integer) hm.get("owner_id")).intValue());
UserAccountDAO uaDAO = new UserAccountDAO(this.ds);
UserAccountBean owner = (UserAccountBean) uaDAO.findByPK(fb.getOwnerId());
fb.setOwner(owner);
return fb;
}
use of org.akaza.openclinica.bean.extract.ArchivedDatasetFileBean in project OpenClinica by OpenClinica.
the class ArchivedDatasetFileDAO method findByDatasetId.
public ArrayList findByDatasetId(int did) {
// ArchivedDatasetFileBean fb = new ArchivedDatasetFileBean();
this.setTypesExpected();
ArrayList al = new ArrayList();
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(did));
String sql = digester.getQuery("findByDatasetId");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
while (it.hasNext()) {
ArchivedDatasetFileBean fb = (ArchivedDatasetFileBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(fb);
}
return al;
}
Aggregations