Java Code Examples for org.hibernate.cfg.Configuration#generateSchemaCreationScript()

The following examples show how to use org.hibernate.cfg.Configuration#generateSchemaCreationScript() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SchemaExport.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Create a schema exporter for the given Configuration
 * and given settings
 */
public SchemaExport(Configuration cfg, Settings settings) throws HibernateException {
	dialect = settings.getDialect();
	connectionHelper = new SuppliedConnectionProviderConnectionHelper(
			settings.getConnectionProvider()
	);
	dropSQL = cfg.generateDropSchemaScript( dialect );
	createSQL = cfg.generateSchemaCreationScript( dialect );
	format = settings.isFormatSqlEnabled();
}
 
Example 2
Source File: SchemaExport.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Create a schema exporter for the given Configuration, with the given
 * database connection properties.
 *
 * @deprecated properties may be specified via the Configuration object
 */
public SchemaExport(Configuration cfg, Properties properties)
		throws HibernateException {
	dialect = Dialect.getDialect( properties );

	Properties props = new Properties();
	props.putAll( dialect.getDefaultProperties() );
	props.putAll( properties );

	connectionHelper = new ManagedProviderConnectionHelper( props );
	dropSQL = cfg.generateDropSchemaScript( dialect );
	createSQL = cfg.generateSchemaCreationScript( dialect );
	format = PropertiesHelper.getBoolean( Environment.FORMAT_SQL, props );
}
 
Example 3
Source File: SchemaExport.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public SchemaExport(Configuration cfg, Connection connection) {
	this.connectionHelper = new SuppliedConnectionHelper( connection );
	dialect = Dialect.getDialect( cfg.getProperties() );
	dropSQL = cfg.generateDropSchemaScript( dialect );
	createSQL = cfg.generateSchemaCreationScript( dialect );
}