Package org.mybeans.dao

Examples of org.mybeans.dao.DAOException


    try{
        Transaction.begin();
      factory.delete(medid);
        Transaction.commit();
    }catch (RollbackException e){
      throw new DAOException(e);
    }
  }   
View Full Code Here


    try{
      Medication[] meds = factory.match(MatchArg.equals("username",UserName));
      return meds;
    }catch(RollbackException e){
      try {
        throw new DAOException(e);
      } catch (DAOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
      }
    }
View Full Code Here

  public Medication getMedName(int Medid){
    try{
      return factory.lookup(Medid);
    }catch(RollbackException e){
      try {
        throw new DAOException(e);
      } catch (DAOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
      }
    }
View Full Code Here

  }
  public int getMedNum(String UserName) throws DAOException{
    try{
      return factory.match(MatchArg.equals("username",UserName)).length;
    }catch(RollbackException e){
      throw new DAOException(e);
    }
  }
View Full Code Here

  }
  public int size() throws DAOException{
    try{
      return factory.getBeanCount();
    }catch(RollbackException e){
      throw new DAOException(e);
    }
  }
View Full Code Here

        }
          Transaction.commit();
          return Large;
      }catch (RollbackException e) {
        try {
          throw new DAOException(e);
        } catch (DAOException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
      }
View Full Code Here

      BeanTable<SideEffectLog> MedTable = BeanTable.getInstance(SideEffectLog.class, "Logsideeffect_table");
      if(!MedTable.exists()) MedTable.create("sideId");
      MedTable.setIdleConnectionCleanup(true);
      factory = MedTable.getFactory();
    }catch(BeanFactoryException e){
      throw new DAOException(e);
    }
  }
View Full Code Here

      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){
      throw new DAOException(e);
    }finally{
      if(Transaction.isActive()) Transaction.rollback();
    }
  }
View Full Code Here

    try{
      SideEffectLog[] sides = factory.match(MatchArg.equals("owner",UserName));
      return sides;
    }catch(RollbackException e){
      try {
        throw new DAOException(e);
      } catch (DAOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
      }
    }
View Full Code Here

    try{
      SideEffectLog[] sides = factory.match(MatchArg.and(MatchArg.equals("name",name), MatchArg.equals("owner", user)));
      return sides;
    }catch(RollbackException e){
      try {
        throw new DAOException(e);
      } catch (DAOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
      }
    }
View Full Code Here

TOP

Related Classes of org.mybeans.dao.DAOException

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.