use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.
the class ItemGroupDAO method findByOid.
public ItemGroupBean findByOid(String oid) {
ItemGroupBean itemGroup = new ItemGroupBean();
this.unsetTypeExpected();
setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), oid);
String sql = digester.getQuery("findGroupByOid");
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
if (it.hasNext()) {
itemGroup = (ItemGroupBean) this.getEntityFromHashMap((HashMap) it.next());
return itemGroup;
} else {
return null;
}
}
use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.
the class ItemGroupDAO method findGroupByCRFVersionIDMap.
public List<ItemGroupBean> findGroupByCRFVersionIDMap(int Id) {
this.setTypesExpected();
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(1, Id);
List listofMaps = this.select(digester.getQuery("findGroupByCRFVersionIDMap"), variables);
List<ItemGroupBean> beanList = new ArrayList<ItemGroupBean>();
ItemGroupBean bean;
for (Object map : listofMaps) {
bean = (ItemGroupBean) this.getEntityFromHashMap((HashMap) map);
beanList.add(bean);
}
return beanList;
}
use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.
the class ItemGroupDAO method findByPK.
public EntityBean findByPK(int ID) {
ItemGroupBean formGroupB = new ItemGroupBean();
this.setTypesExpected();
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(1, ID);
String sql = digester.getQuery("findByPK");
ArrayList listofMap = this.select(sql, variables);
for (Object map : listofMap) {
formGroupB = (ItemGroupBean) this.getEntityFromHashMap((HashMap) map);
}
return formGroupB;
}
use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.
the class ItemGroupDAO method findGroupsByItemID.
// YW 10-30-2007, one item_id might have more than one item_groups
public Collection findGroupsByItemID(int ID) {
this.setTypesExpected();
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(1, ID);
List listofMap = this.select(digester.getQuery("findGroupsByItemID"), variables);
List<ItemGroupBean> formGroupBs = new ArrayList<ItemGroupBean>();
for (Object map : listofMap) {
ItemGroupBean bean = (ItemGroupBean) this.getEntityFromHashMap((HashMap) map);
formGroupBs.add(bean);
}
return formGroupBs;
}
use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.
the class ItemGroupDAO method findByOidAndCrf.
public ItemGroupBean findByOidAndCrf(String oid, int crfId) {
ItemGroupBean itemGroup = new ItemGroupBean();
this.unsetTypeExpected();
setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), oid);
variables.put(new Integer(2), new Integer(crfId));
String sql = digester.getQuery("findGroupByOidAndCrfId");
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
if (it.hasNext()) {
itemGroup = (ItemGroupBean) this.getEntityFromHashMap((HashMap) it.next());
return itemGroup;
} else {
return null;
}
}
Aggregations