Package lib.exceptions

Examples of lib.exceptions.ObjectAlreadyInsertedException


        stmt = (Statement) mp.getCommunicationChannel();
        sql = "SELECT * FROM scbs_endereco WHERE codigo = '" + end.getId() + "'";
        resultSet = stmt.executeQuery(sql);

        if (resultSet.next()) {
          throw new ObjectAlreadyInsertedException(ExceptionMessages.EXC_JA_EXISTE);
        }
        resultSet.close();
        stmt.close();
      } catch (SQLException e) {
        throw new SQLPersistenceMechanismException(ExceptionMessages.EXC_FALHA_BD, sql);
View Full Code Here


      ObjectAlreadyInsertedException, ObjectNotValidException, RepositoryException {
    //#if relacional
    manager.beginExecution(employee.getLogin());
    //#endif
    if (employeeRepository.exists(employee.getLogin())) {
      throw new ObjectAlreadyInsertedException(ExceptionMessages.EXC_JA_EXISTE);
    } else {
      employeeRepository.insert(employee);
    }
    //#if relacional
    manager.endExecution(employee.getLogin());
View Full Code Here

    try {
      //#if relacional
      manager.beginExecution("" + diseaseType.getId());
     
      if (diseaseRep.exists(diseaseType.getId())) {
        throw new ObjectAlreadyInsertedException(ExceptionMessages.EXC_JA_EXISTE);
      } else {
        this.diseaseRep.insert(diseaseType);
      }
      //#endif
     
View Full Code Here

  public Long insert(Complaint complaint) throws ObjectNotValidException,//change return int to Long
  ObjectAlreadyInsertedException, ObjectNotValidException, RepositoryException {
    this.validate(complaint);
    if (complaintRep.exists(complaint.getCodigo())) {
      throw new ObjectAlreadyInsertedException("Complaint code already registered");
    }
    return complaintRep.insert(complaint);
  }
View Full Code Here

      ObjectNotValidException {
    try {
      //#if relacional
      manager.beginExecution("" + symptom.getId());
      if (rep.exists(symptom.getId())) {
        throw new ObjectAlreadyInsertedException(ExceptionMessages.EXC_JA_EXISTE);
      } else {
        rep.insert(symptom);
      }
      //#endif
     
View Full Code Here

TOP

Related Classes of lib.exceptions.ObjectAlreadyInsertedException

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.