use of org.akaza.openclinica.bean.core.EntityBean in project OpenClinica by OpenClinica.
the class StudyEventDAO method removeDouble.
// so as to remove the object correctly, tbh
public HashMap removeDouble(HashMap hm, EntityBean event) {
ArrayList al = new ArrayList();
Set s = hm.entrySet();
EntityBean removeMe = new EntityBean();
for (Iterator it = s.iterator(); it.hasNext(); ) {
Map.Entry me = (Map.Entry) it.next();
EntityBean eb = (EntityBean) me.getKey();
if (eb.getId() == event.getId() && eb.getName().equals(event.getName())) {
logger.warn("found OLD bean, remove it");
removeMe = eb;
}
}
hm.remove(removeMe);
return hm;
}
use of org.akaza.openclinica.bean.core.EntityBean in project OpenClinica by OpenClinica.
the class StudyEventDAO method returnDouble.
// so as not to get null pointer returns, tbh
public ArrayList returnDouble(HashMap hm, EntityBean event) {
ArrayList al = new ArrayList();
Set s = hm.entrySet();
for (Iterator it = s.iterator(); it.hasNext(); ) {
Map.Entry me = (Map.Entry) it.next();
EntityBean eb = (EntityBean) me.getKey();
if (eb.getId() == event.getId() && eb.getName().equals(event.getName())) {
// logger.warn("found OLD bean, return true");
al = (ArrayList) me.getValue();
}
}
return al;
}
use of org.akaza.openclinica.bean.core.EntityBean in project OpenClinica by OpenClinica.
the class StudyEventDAO method findDouble.
// TODO make sure we are returning the correct boolean, tbh
public boolean findDouble(HashMap hm, EntityBean event) {
boolean returnMe = false;
Set s = hm.entrySet();
for (Iterator it = s.iterator(); it.hasNext(); ) {
Map.Entry me = (Map.Entry) it.next();
EntityBean eb = (EntityBean) me.getKey();
if (eb.getId() == event.getId() && eb.getName().equals(event.getName())) {
logger.warn("found OLD bean, return true");
returnMe = true;
}
}
return returnMe;
}
use of org.akaza.openclinica.bean.core.EntityBean in project OpenClinica by OpenClinica.
the class ItemDataDAO method findByItemIdAndEventCRFIdAndOrdinal.
// YW, 1-25-2008, for repeating item
public ItemDataBean findByItemIdAndEventCRFIdAndOrdinal(int itemId, int eventCRFId, int ordinal) {
setTypesExpected();
ItemDataBean answer = new ItemDataBean();
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(new Integer(1), new Integer(itemId));
variables.put(new Integer(2), new Integer(eventCRFId));
variables.put(new Integer(3), new Integer(ordinal));
EntityBean eb = this.executeFindByPKQuery("findByItemIdAndEventCRFIdAndOrdinal", variables);
if (!eb.isActive()) {
// hmm, return null instead?
return new ItemDataBean();
} else {
return (ItemDataBean) eb;
}
}
use of org.akaza.openclinica.bean.core.EntityBean in project OpenClinica by OpenClinica.
the class ItemDataDAO method findByItemIdAndEventCRFIdAndOrdinalRaw.
public ItemDataBean findByItemIdAndEventCRFIdAndOrdinalRaw(int itemId, int eventCRFId, int ordinal) {
setTypesExpected();
ItemDataBean answer = new ItemDataBean();
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(new Integer(1), new Integer(itemId));
variables.put(new Integer(2), new Integer(eventCRFId));
variables.put(new Integer(3), new Integer(ordinal));
EntityBean eb = this.executeFindByPKQuery("findByItemIdAndEventCRFIdAndOrdinal", variables);
if (!eb.isActive()) {
// hmm, return null instead?
return new ItemDataBean();
} else {
return (ItemDataBean) eb;
}
}
Aggregations