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

org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha1
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.tool.hbm2ddl;

import java.io.Reader;
import java.util.List;

import org.hibernate.tool.schema.ast.SqlScriptParser;

/**
 * Class responsible for extracting SQL statements from import script. Supports instructions/comments and quoted
 * strings spread over multiple lines. Each statement must end with semicolon.
 * 
 * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
 * @author Steve Ebersole
 */
public class MultipleLinesSqlCommandExtractor implements ImportSqlCommandExtractor {
	@Override
	public String[] extractCommands(Reader reader) {
		final List commands = SqlScriptParser.extractCommands( reader );

		return commands.toArray( new String[0] );
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy