org.hibernate.testing.cleaner.DatabaseCleaner Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of hibernate-testing Show documentation
                Show all versions of hibernate-testing Show documentation
Support for testing Hibernate ORM functionality
                
             The newest version!
        
        /*
 * SPDX-License-Identifier: Apache-2.0
 * Copyright Red Hat Inc. and Hibernate Authors
 */
package org.hibernate.testing.cleaner;
import java.sql.Connection;
/**
 * @author Christian Beikov
 */
public interface DatabaseCleaner {
	static void clearSchemas() {
		final DatabaseCleaner cleaner = DatabaseCleanerContext.CLEANER;
		if ( cleaner != null ) {
			JdbcConnectionContext.work( cleaner::clearAllSchemas );
		}
	}
	static void clearData() {
		final DatabaseCleaner cleaner = DatabaseCleanerContext.CLEANER;
		if ( cleaner != null ) {
			JdbcConnectionContext.work( cleaner::clearAllData );
		}
	}
	void addIgnoredTable(String tableName);
	boolean isApplicable(Connection connection);
	void clearAllSchemas(Connection connection);
	void clearSchema(Connection connection, String schemaName);
	void clearAllData(Connection connection);
	void clearData(Connection connection, String schemaName);
}
    © 2015 - 2025 Weber Informatics LLC | Privacy Policy