当前位置: 首页>>代码示例>>Java>>正文


Java Dialect.getDialect方法代码示例

本文整理汇总了Java中org.hibernate.dialect.Dialect.getDialect方法的典型用法代码示例。如果您正苦于以下问题:Java Dialect.getDialect方法的具体用法?Java Dialect.getDialect怎么用?Java Dialect.getDialect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.dialect.Dialect的用法示例。


在下文中一共展示了Dialect.getDialect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SchemaExport

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
/**
 * Create a schema exporter for the given Configuration, with the given
 * database connection properties.
 *
 * @param configuration The configuration from which to build a schema export.
 * @param properties The properties from which to configure connectivity etc.
 * @throws HibernateException Indicates problem preparing for schema export.
 *
 * @deprecated properties may be specified via the Configuration object
 */
@Deprecated
   public SchemaExport(Configuration configuration, Properties properties) throws HibernateException {
	final Dialect dialect = Dialect.getDialect( properties );

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

	this.sqlStatementLogger = new SqlStatementLogger( false, true );
	this.formatter = FormatStyle.DDL.getFormatter();
	this.sqlExceptionHelper = new SqlExceptionHelper();

	this.importFiles = ConfigurationHelper.getString(
			AvailableSettings.HBM2DDL_IMPORT_FILES,
			properties,
			DEFAULT_IMPORT_FILE
	);

	this.dropSQL = configuration.generateDropSchemaScript( dialect );
	this.createSQL = configuration.generateSchemaCreationScript( dialect );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:33,代码来源:SchemaExport.java

示例2: executeScriptUrl

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
private void executeScriptUrl(Configuration cfg, Connection connection, String scriptUrl) throws Exception
{
    Dialect dialect = Dialect.getDialect(cfg.getProperties());
    String dialectStr = dialect.getClass().getSimpleName();
    InputStream scriptInputStream = getScriptInputStream(dialect.getClass(), scriptUrl);
    // check that it exists
    if (scriptInputStream == null)
    {
        throw AlfrescoRuntimeException.create(ERR_SCRIPT_NOT_FOUND, scriptUrl);
    }
    // write the script to a temp location for future and failure reference
    File tempFile = null;
    try
    {
        tempFile = TempFileProvider.createTempFile("AlfrescoSchema-" + dialectStr + "-Update-", ".sql");
        ContentWriter writer = new FileContentWriter(tempFile);
        writer.putContent(scriptInputStream);
    }
    finally
    {
        try { scriptInputStream.close(); } catch (Throwable e) {}  // usually a duplicate close
    }
    // now execute it
    String dialectScriptUrl = scriptUrl.replaceAll(PLACEHOLDER_DIALECT, dialect.getClass().getName());
    // Replace the script placeholders
    executeScriptFile(cfg, connection, tempFile, dialectScriptUrl);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:ScriptExecutorImpl.java

示例3: SchemaUpdate

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
public SchemaUpdate(Configuration configuration, Properties properties) throws HibernateException {
	this.configuration = configuration;
	this.dialect = Dialect.getDialect( properties );

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

	this.sqlExceptionHelper = new SqlExceptionHelper();
	this.sqlStatementLogger = new SqlStatementLogger( false, true );
	this.formatter = FormatStyle.DDL.getFormatter();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:SchemaUpdate.java

示例4: SchemaValidator

import org.hibernate.dialect.Dialect; //导入方法依赖的package包/类
public SchemaValidator(Configuration cfg, Properties connectionProperties) throws HibernateException {
	this.configuration = cfg;
	dialect = Dialect.getDialect( connectionProperties );
	Properties props = new Properties();
	props.putAll( dialect.getDefaultProperties() );
	props.putAll( connectionProperties );
	connectionHelper = new ManagedProviderConnectionHelper( props );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:SchemaValidator.java


注:本文中的org.hibernate.dialect.Dialect.getDialect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。