當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。