Package databeans

Examples of databeans.SideEffect


    }
  }
  public void create(SideEffect side) throws DAOException {
    try{
      Transaction.begin();
      SideEffect dbSide = factory.create(side.getSideid());
      factory.copyInto(side,dbSide);
      Transaction.commit();
    }catch(DuplicateKeyException e){
      throw new DAOException("A Side effect  named " + side.getName() + "has already existed.");
    }catch(RollbackException e){
View Full Code Here


          }
          String newSide;
          //if user want some side effects  be deleted.
          if(delSide != null){
            newSide = delSide;
            addSide = new SideEffect(Integer.parseInt(newSide));
            addSide.setName(form.getName());
            addSide.setOwner(user.getEmailAddress());
            //addSide.setAllNum(allNum + 1); 
            //create a new user.
            sideDAO.create(addSide);
            synchronized(session){session.setAttribute("deletelistside",delListside);}
          //if no scheduled medication be deleted.
          }else{
            int allSize = sideDAO.size();
            //initialization situation.
            if(allSize == 0){
              newSide = Integer.toString(allSize);
              addSide = new SideEffect(Integer.parseInt(newSide));
              addSide.setName(form.getName());
                addSide.setOwner(user.getEmailAddress());
                sideDAO.create(addSide);
                synchronized(session){session.setAttribute("deletelistside",delListside);}
            }else{
              allSize = sideDAO.getLastId();
              newSide = Integer.toString(allSize);
              addSide = new SideEffect(Integer.parseInt(newSide) + 1);
              addSide.setName(form.getName());
                addSide.setOwner(user.getEmailAddress());
                sideDAO.create(addSide);
                synchronized(session){session.setAttribute("deletelistside",delListside);}
            }
View Full Code Here

TOP

Related Classes of databeans.SideEffect

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.