/**
* Controller method to download a ddl.
*/
@Deprecated
@SuppressWarnings({"unchecked", "rawtypes"})
@RequestMapping(value = "ddl", method = RequestMethod.GET)
public void exportDatabaseSchema(HttpServletRequest request, HttpServletResponse response, Model uiModel) {
PersistenceUnitInfo persistenceUnitInfo = getEntityManagerFactory().getPersistenceUnitInfo();
Map jpaPropertyMap = getEntityManagerFactory().getJpaPropertyMap();
jpaPropertyMap.put("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
Configuration configuration = new Ejb3Configuration().configure(persistenceUnitInfo, jpaPropertyMap).getHibernateConfiguration();
SchemaExport schema = new SchemaExport(configuration);
schema.setFormat(true);
schema.setDelimiter(";");
schema.setOutputFile("/tmp/schema.sql");
schema.create(false, false);
}
HomeController.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:mobile-starting-framework
作者:
评论列表
文章目录