本文整理了Java中org.hibernate.cfg.Configuration.generateSchemaUpdateScriptList()
方法的一些代码示例,展示了Configuration.generateSchemaUpdateScriptList()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.generateSchemaUpdateScriptList()
方法的具体详情如下:
包路径:org.hibernate.cfg.Configuration
类名称:Configuration
方法名:generateSchemaUpdateScriptList
暂无
代码示例来源:origin: riotfamily/riot
public void execute(Connection connection) throws SQLException {
Dialect dialect = Dialect.getDialect(getConfiguration()
.getProperties());
DatabaseMetadata metadata = new DatabaseMetadata(connection,
dialect, getConfiguration());
List<SchemaUpdateScript> schemaUpdates = getConfiguration()
.generateSchemaUpdateScriptList(dialect, metadata);
if (schemaUpdates.size() > 0) {
log.error("The database schema is not up-to-date.\n"
+ "Please execute the following statements:\n"
+ FormatUtils.repeat("-", 80) + "\n"
+ StringUtils.arrayToDelimitedString(
SchemaUpdateScript
.toStringArray(schemaUpdates),
";\n") + ";\n"
+ FormatUtils.repeat("-", 80));
throw new HibernateException("Invalid database schema");
}
}
});
代码示例来源:origin: com.github.mg365/mg-common
configuration.setNamingStrategy(new JPAImprovedNamingStrategy());
configuration.buildMappings();
List<SchemaUpdateScript> result = configuration.generateSchemaUpdateScriptList(Dialect.getDialect(configuration.getProperties()), new DatabaseMetadata(con, Dialect.getDialect(configuration.getProperties()), configuration));
内容来源于网络,如有侵权,请联系作者删除!