All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor Maven / Gradle / Ivy

The newest version!
package org.nuiton.topia.service.migration.resources;

/*-
 * #%L
 * ObServe Toolkit :: ToPIA Migration service
 * %%
 * Copyright (C) 2017 - 2018 IRD, Ultreia.io
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * .
 * #L%
 */

import org.nuiton.topia.persistence.support.TopiaSqlQuery;
import org.nuiton.topia.persistence.support.TopiaSqlWork;

import java.io.Closeable;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;

/**
 * Context used at runtime on {@link MigrationVersionResource#generateSqlScript(MigrationVersionResourceExecutor)}.
 * 

* Created by tchemit on 06/05/2018. * * @author Tony Chemit - [email protected] */ public interface MigrationVersionResourceExecutor extends Closeable { void writeSql(String sql); void addScript(String rank, String prefix); O findSingleResult(TopiaSqlQuery query); List findMultipleResult(TopiaSqlQuery query); Set findMultipleResultAstSet(TopiaSqlQuery query); void doSqlWork(TopiaSqlWork sqlWork); Set getTopiaIds(String tableName); String getUniqueConstraintName(String tableName, String columnName); String getFirstTableUniqueConstraintName(String tableName); Set getConstraintNames(String tableName); Set getForeignKeyConstraintNames(String tableName); String getForeignKeyConstraintName(String schemaName, String tableName, String columnName, boolean mustExists); Set getUniqueKeyConstraintNames(String tableName); void removeFK(String tableName); void removeFK(String schemaName, String tableName, String columnName); void removeFKIfExists(String schemaName, String tableName, String columnName); void removeUK(String tableName); void executeForPG(Consumer consumer); void executeForH2(Consumer consumer); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy