public static void main(String[] args) {
Ejb3Configuration ejb3Cfg = new Ejb3Configuration();
// set propeties (these were set based on the persistence.xml file)
Properties props = new Properties();
props.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
ejb3Cfg.addProperties(props);
ejb3Cfg.setNamingStrategy(ImprovedNamingStrategy.INSTANCE);
// add annotated classes
ejb3Cfg.addAnnotatedClass(EndUser.class);
ejb3Cfg.addAnnotatedClass(Individual.class);
ejb3Cfg.addAnnotatedClass(Location.class);
ejb3Cfg.addAnnotatedClass(SocialGroup.class);
ejb3Cfg.addAnnotatedClass(Visit.class);
Configuration cfg = ejb3Cfg.getHibernateConfiguration();
SchemaExport se = new SchemaExport(cfg).setOutputFile(RESOURCES_PATH + "specialstudy-schema-ddl.sql");
se.execute(false, false, false, true);
}
Ejb3SchemaExport.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:openhds-server
作者:
评论列表
文章目录