Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright 2010-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.migration.operations;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.apache.ibatis.jdbc.SqlRunner;
import org.apache.ibatis.migration.Change;
import org.apache.ibatis.migration.ConnectionProvider;
import org.apache.ibatis.migration.MigrationException;
import org.apache.ibatis.migration.options.DatabaseOperationOption;
public abstract class DatabaseOperation {
protected void insertChangelog(Change change, ConnectionProvider connectionProvider, DatabaseOperationOption option) {
SqlRunner runner = getSqlRunner(connectionProvider);
change.setAppliedTimestamp(generateAppliedTimeStampAsString());
try {
runner.insert("insert into " + option.getChangelogTable() + " (ID, APPLIED_AT, DESCRIPTION) values (?,?,?)",
change.getId(), change.getAppliedTimestamp(), change.getDescription());
} catch (SQLException e) {
throw new MigrationException("Error querying last applied migration. Cause: " + e, e);
} finally {
runner.closeConnection();
}
}
protected List getChangelog(ConnectionProvider connectionProvider, DatabaseOperationOption option) {
SqlRunner runner = getSqlRunner(connectionProvider);
try {
List