Exemple #1
0
 public EntityBean update(EntityBean eb) {
   ItemBean ib = (ItemBean) eb;
   HashMap variables = new HashMap();
   variables.put(new Integer(1), ib.getName());
   variables.put(new Integer(2), ib.getDescription());
   variables.put(new Integer(3), ib.getUnits());
   variables.put(new Integer(4), new Boolean(ib.isPhiStatus()));
   variables.put(new Integer(5), new Integer(ib.getItemDataTypeId()));
   variables.put(new Integer(6), new Integer(ib.getItemReferenceTypeId()));
   variables.put(new Integer(7), new Integer(ib.getStatus().getId()));
   variables.put(new Integer(8), new Integer(ib.getUpdaterId()));
   variables.put(new Integer(9), new Integer(ib.getId()));
   this.execute(digester.getQuery("update"), variables);
   return eb;
 }
Exemple #2
0
 public EntityBean create(EntityBean eb) {
   ItemBean ib = (ItemBean) eb;
   // per the create sql statement
   HashMap variables = new HashMap();
   variables.put(new Integer(1), ib.getName());
   variables.put(new Integer(2), ib.getDescription());
   variables.put(new Integer(3), ib.getUnits());
   variables.put(new Integer(4), new Boolean(ib.isPhiStatus()));
   variables.put(new Integer(5), new Integer(ib.getItemDataTypeId()));
   variables.put(new Integer(6), new Integer(ib.getItemReferenceTypeId()));
   variables.put(new Integer(7), new Integer(ib.getStatus().getId()));
   variables.put(new Integer(8), new Integer(ib.getOwnerId()));
   // date_created=now() in Postgres
   this.execute(digester.getQuery("create"), variables);
   // set the id here????
   return eb;
 }