/** * Generates the DDL schema * @param dialect the dialect to use (complete class name for the hibernate dialect object) * @return an array containing the SQL statements */ public static String[] generateCreateSchemaDDL(String dialect) { Properties props = new Properties(); props.put(Environment.DIALECT, dialect); Configuration cfg = createConfiguration(props); String[] sqls = cfg.generateSchemaCreationScript(Dialect.getDialect(props)); addDelimiters(sqls); return sqls; }
/** * Generates the DDL schema * @param dialect the dialect to use (complete class name for the hibernate dialect object) * @return an array containing the SQL statements */ public static String[] generateDropSchemaDDL(String dialect) { Properties props = new Properties(); props.put(Environment.DIALECT, dialect); Configuration cfg = createConfiguration(props); String[] sqls = cfg.generateSchemaCreationScript(Dialect.getDialect(props)); addDelimiters(sqls); return sqls; }
/** * Generates the DDL schema * @param dialect the dialect to use (complete class name for the hibernate dialect object) * @return an array containing the SQL statements */ public static String[] generateDropSchemaDDL(String dialect) { Properties props = new Properties(); props.put(Environment.DIALECT, dialect); Configuration cfg = createConfiguration(props); String[] sqls = cfg.generateSchemaCreationScript(Dialect.getDialect(props)); addDelimiters(sqls); return sqls; }
/** * Generates the DDL schema * @param dialect the dialect to use (complete class name for the hibernate dialect object) * @return an array containing the SQL statements */ public static String[] generateCreateSchemaDDL(String dialect) { Properties props = new Properties(); props.put(Environment.DIALECT, dialect); Configuration cfg = createConfiguration(props); String[] sqls = cfg.generateSchemaCreationScript(Dialect.getDialect(props)); addDelimiters(sqls); return sqls; }
public static String[] generateUpdateSchemaDDL(String dialect, Connection connection) throws SQLException { Properties props = new Properties(); props.put(Environment.DIALECT, dialect); Configuration cfg = createConfiguration(props); final Dialect dialectObj = Dialect.getDialect(props); String[] sqls = cfg.generateSchemaUpdateScript(dialectObj, new DatabaseMetadata(connection, dialectObj) ); addDelimiters(sqls); return sqls; }
public static String[] generateUpdateSchemaDDL(String dialect, Connection connection) throws SQLException { Properties props = new Properties(); props.put(Environment.DIALECT, dialect); Configuration cfg = createConfiguration(props); final Dialect dialectObj = Dialect.getDialect(props); String[] sqls = cfg.generateSchemaUpdateScript(dialectObj, new DatabaseMetadata(connection, dialectObj) ); addDelimiters(sqls); return sqls; }