Examples of MigrationException


Examples of com.salas.bb.persistence.backend.migration.MigrationException

        try
        {
            perform();
        } catch (SQLException e)
        {
            throw new MigrationException(Strings.error("db.failed.to.update.database"), e);
        }
    }
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper1.exceptions.MigrationException

        // the test for the file name mappings, as they are solely based on the
        // configuration file and what the generic wrapper is doing.

        if (!validIdentifiers.containsAll(usedIdentifiers)) {
            usedIdentifiers.removeAll(validIdentifiers);
            throw new MigrationException("Cannot build the command line. "
                    + "Missing values for these identifiers: "
                    + usedIdentifiers);
        }

        List<String> executableCommandLine = new ArrayList<String>();
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationException

            Map<String, String> identifierMap,
            Map<String, File> tempFileMappings) throws MigrationException {

        for (String tempFileLabel : tempFileMappings.keySet()) {
            if (identifierMap.containsKey(tempFileLabel)) {
                throw new MigrationException(String.format(
                        "The identifier map already contains an element with "
                                + "the key '%s'. Cannot add the temporay file "
                                + "mapping '%s = %s'.", tempFileLabel,
                        tempFileLabel, tempFileMappings.get(tempFileLabel)));
            }

            try {
                identifierMap.put(tempFileLabel, tempFileMappings.get(
                        tempFileLabel).getCanonicalPath());
            } catch (SecurityException se) {
                throw new MigrationException(
                        String.format(
                                "Failed accessing the canonical file path of the "
                                        + "temporary file labeled '%s'",
                                tempFileLabel), se);
            } catch (IOException ioe) {
                throw new MigrationException(
                        String.format(
                                "Failed accessing the canonical file path of the "
                                        + "temporary file labeled '%s'",
                                tempFileLabel), ioe);
            }
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationException

  protected void ensureDirectoryIsEmpty(File path) {
    String[] list = path.list();
    if (list.length != 0) {
      for (String entry : list) {
        if (!entry.startsWith(".")) {
          throw new MigrationException("Directory must be empty (.svn etc allowed): " + path.getAbsolutePath());
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationException

    if (!path.exists()) {
      File parent = new File(path.getParent());
      createDirectoryIfNecessary(parent);
      out.println("Creating: " + path.getName());
      if (!path.mkdir()) {
        throw new MigrationException("Could not create directory path for an unknown reason. Make sure you have access to the directory.");
      }
    }
  }
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationException

    super(repository, environment, force);
  }

  public void execute(String... params) {
    if (paramsEmpty(params)) {
      throw new MigrationException("No description specified for new migration.");
    }
    String description = params[0];
    Properties variables = new Properties();
    variables.setProperty("description", description);
    existingEnvironmentFile();
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationException

          }
          lastChange = getLastAppliedChange();
        }
      }
    } catch (Exception e) {
      throw new MigrationException("Error undoing last migration.  Cause: " + e, e);
    }
  }
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationException

  protected void deleteChange(Change change) {
    SqlRunner runner = getSqlRunner();
    try {
      runner.delete("delete from " + changelogTable() + " where id = ?", change.getId());
    } catch (SQLException e) {
      throw new MigrationException("Error querying last applied migration.  Cause: " + e, e);
    } finally {
      runner.closeConnection();
    }
  }
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationException

  }

  protected List<Change> getMigrations() {
    String[] filenames = scriptPath.list();
    if (filenames == null) {
      throw new MigrationException(scriptPath + " does not exist.");
    }
    Arrays.sort(filenames);
    List<Change> migrations = new ArrayList<Change>();
    for (String filename : filenames) {
      if (filename.endsWith(".sql") && !"bootstrap.sql".equals(filename)) {
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationException

        String description = change.get("DESCRIPTION") == null ? null : change.get("DESCRIPTION").toString();
        changes.add(new Change(new BigDecimal(id), appliedAt, description));
      }
      return changes;
    } catch (SQLException e) {
      throw new MigrationException("Error querying last applied migration.  Cause: " + e, e);
    } finally {
      runner.closeConnection();
    }
  }
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.