public JbpmSchemaUpdate(Configuration cfg, Properties connectionProperties)
     throws HibernateException {
   this.configuration = cfg;
   dialect = Dialect.getDialect(connectionProperties);
   Properties props = new Properties();
   props.putAll(dialect.getDefaultProperties());
   props.putAll(connectionProperties);
   connectionProvider = ConnectionProviderFactory.newConnectionProvider(props);
   exceptions = new ArrayList();
 }
示例#2
0
  /**
   * 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);
  }