Examples of DaoException


Examples of at.fhj.itm.dao.DAOException

  @Test
  public void testBookTripUpdateException() throws SQLException {
    // Setup Mocks:
    mockBegin();
    mockWaypointDAO.update(mockBookerWaypointInactive,mockGetConnection());
    EasyMock.expectLastCall().andThrow(new DAOException("DAO Exception"));
    mockRollback();
    mockCloseConnection();

    replayMocks();
    // Do Test:
View Full Code Here

Examples of br.com.buyFast.integration.dao.DaoException

      getSessionFactory().getCurrentSession().save(object);
      logger.info("Objeto " + getObjectClass().getSimpleName() + " salvo com sucesso.");
    } catch (Exception e) {
      String messageError = "Erro ao salvar objeto " + getObjectClass().getSimpleName();
      logger.error(messageError, e);
      throw new DaoException(messageError, e);
    }
   
    return object;
  }
View Full Code Here

Examples of br.com.fiapbank.persistencia.dao.DaoException

        .add( Restrictions.eq("numeroAgencia", conta.getNumeroAgencia()))
        .add( Restrictions.eq("senha", conta.getSenha()))
        .add( Restrictions.eq("fraseSecreta", conta.getFraseSecreta()))
        .uniqueResult();
    } catch (Exception e) {
      throw new DaoException(e);
    }
  }
View Full Code Here

Examples of br.facet.tcc.exception.DaoException

        Integer integer = null;
        try {
            integer = (Integer) save(t);
            logger.debug("Objeto salvo com sucesso em " + t.getClass());
        } catch (HibernateException e) {
            throw new DaoException(e);
        }
        return integer;
    }
View Full Code Here

Examples of br.gov.serpro.ouvidoria.dao.DaoException

   * @return
   * @throws DaoException
   */
  public LocalidadeOcorrencia get(final Long id) throws DaoException {
    if (id == null) {
      throw new DaoException("ID do Objeto não pode ser nulo.");
    }
    return (LocalidadeOcorrencia) localidadeOcorrenciaDao.get(id);
  }
View Full Code Here

Examples of by.bsuir.hypermarket.dao.exception.DaoException

        fillUpAddress(resultSet, address);
        addresses.add(address);
      }
    } catch (ConnectionPoolException e) {
      log.error("Error during getting connection from the pool", e);
      throw new DaoException(e);
    } catch (SQLException e) {
      log.error("Error during searching all address entities", e);
      throw new DaoException(e);
    }

    return addresses;
  }
View Full Code Here

Examples of com.alexnevsky.hotel.dao.exception.DAOException

      resultSet = preparedStatement.executeQuery();
      if (resultSet.next()) {
        admin = mapAdmin(resultSet);
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return admin;
View Full Code Here

Examples of com.cedarsolutions.exception.DaoException

    }

    /** Commit a transaction. */
    public void commit() {
        if (!this.transactional) {
           throw new DaoException("This Objectify instance is not transactional.");
        }

        if (this.getTxn().isActive()) {
            this.getTxn().commit();
        }
View Full Code Here

Examples of com.eforce.baby.common.dao.DAOException

      log.debug("ID="+groupVO.getId()+"  ||  "+groupVO.getGroupName());
      ResultSet rset = null;
      rset = pStmt.executeQuery();
      if( rset.next() ){
        if(rset.getInt(1)>0){
          DAOException daox = new DAOException ("Database Error");
          daox.setMessageKey(IErrorMessageKeys.KEY_ERROR_DUPLICATE_GROUP);
          throw daox;
        }
      }

      sql = qManager.getUpdateGroupQuery(dbType);
      log.debug(sql);
      pStmt = con.prepareStatement( sql );
      pStmt.setString( 1, groupVO.getGroupName() );
      pStmt.setString( 2, groupVO.getGroupDesc() );
      pStmt.setString( 3, groupVO.getId());

      pStmt.executeUpdate();

      //first delete old users
      sql = qManager.getDeleteGroupUserQuery(dbType);
      pStmt = con.prepareStatement( sql );
      pStmt.setString( 1, groupVO.getId());
      pStmt.executeUpdate();

      this.createSearchContent(con,dbType, groupVO, "TBL_GROUP", "GROUP_ID");

      String[] userIds = EEMSUtil.convertToArray(groupVO.getUserNames(),IConstants.EEMS_DELIMITER);
      if(userIds!=null)
      {
        sql = qManager.getFindCreateUserGroupQuery(dbType);
        pStmt = con.prepareStatement( sql );
        log.debug(sql);
   
        for (int i=0; i<userIds.length;i++)
        {
          if(userIds[i]!= null)
          {
            log.debug("userID " + userIds[i]);
            log.debug("groupid "+groupVO.getId());
            pStmt.setString( 1, userIds[i].trim() );
            pStmt.setString( 2, groupVO.getId() );
            pStmt.executeUpdate();
            log.debug("user-group added" + i);
          }
        }
   
      }
      log.debug("inserted...and updated");
      con.commit();
    }
    catch(SQLException ex)
    {
      try
      {
        con.rollback();
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        log.error("Error GroupDAO SQLException:" + e);
      }
      DAOException daox = new DAOException ("Database Error");
      daox.setMessageKey(IErrorMessageKeys.KEY_DATABASE_ERROR);
      throw daox;
    }
    finally
    {
      try
      {
        if(pStmt != null) pStmt.close();
        this.releaseConnection(con);
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        log.error("Error GroupDAO SQLException:" + e);
        DAOException daox = new DAOException ("FATAL Error");
        daox.setMessageKey(IErrorMessageKeys.KEY_FATAL_ERROR);
        throw daox;
      }


    }
View Full Code Here

Examples of com.extjs.common.errorhandler.DaoException

      Criterion criterion = Restrictions.eq("userName", userName);
      criteria.add(criterion);
      List <UserDetail> resultSet = criteria.list();
      return resultSet.get(0);
    }catch(Exception ex){
      throw new DaoException(ex);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.