Package databeans

Examples of databeans.SideEffectLog


    }
  }
  public void create(SideEffectLog side) throws DAOException {
    try{
      Transaction.begin();
      SideEffectLog dbMed = factory.create(side.getSideId());
      factory.copyInto(side,dbMed);
      Transaction.commit();
    }catch(DuplicateKeyException e){
      throw new DAOException("A log medication belongs to " + side.getOwner() + "has already existed.");
    }catch(RollbackException e){
View Full Code Here


          String delMed = (String) session.getAttribute("deletid");
          String newMed;
          //if user want some medication schedule be deleted.
          if(delMed != null){
            newMed = delMed;
            logSideMed = new SideEffectLog(Integer.parseInt(newMed));
            logSideMed.setOwner(user.getEmailAddress());
            createLogSide(logSideMed,form);
            //create a new user.
            logsideDAO.create(logSideMed);
          //if no scheduled medication be deleted.
          }else{
            int allSize = logsideDAO.size();
            //initialization situation.
            if(allSize == 0){
              newMed = Integer.toString(allSize);
              logSideMed = new SideEffectLog(Integer.parseInt(newMed));
                logSideMed.setOwner(user.getEmailAddress());
                createLogSide(logSideMed,form);
                //create a new user.
                logsideDAO.create(logSideMed);
            }else{
              allSize = logsideDAO.getLastId();
              newMed = Integer.toString(allSize);
              logSideMed = new SideEffectLog(Integer.parseInt(newMed) + 1);
                logSideMed.setOwner(user.getEmailAddress());
                createLogSide(logSideMed,form);
                //create a new user.
                logsideDAO.create(logSideMed);
            }
View Full Code Here

TOP

Related Classes of databeans.SideEffectLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.