Code example for SchemaExport

Methods: executesetDelimitersetOutputFile

0
   * @param dialect - Database dialect to use 
   */ 
  public void generateSQL(Dialect dialect) {
    configuration.setProperty("hibernate.dialect", dialect.getDialectClass());
 
    SchemaExport export = new SchemaExport(configuration);
    export.setDelimiter(";");
    String outputFile = this.outputDir + File.separator + "ddl_" + dialect.name().toLowerCase() + ".sql";
    export.setOutputFile(outputFile);
    export.execute(false, false, false, !updateSchema);
  } 
 
  /** 
   * Run the schema creation script 
   * 
   * @param jdbcUrl  - the jdbc url for the database in which to run the script 
   * @param dialect- the sql dialect for the database 
   * @param username - the username for the database 
   * @param password - the password to use 
   */