SchemaFromScratchTest.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:dbdiff 作者:
@Test
public void generateCreate() throws ClassNotFoundException {
    final long now = System.currentTimeMillis() - LAST_MODIFIED_PRECISION;
    final Configuration cfg = new Configuration();
    cfg.setProperty("hibernate.hbm2ddl.auto", "create");
    cfg.setProperty("hibernate.dialect", ORACLE_DIALECT);
    cfg.setNamingStrategy(new MyNamingStrategy());

    for (final String className : findEntities()) {
        cfg.addAnnotatedClass(Class.forName(className));
    }

    final SchemaExport export = new SchemaExport(cfg);
    export.setDelimiter(";");
    export.setOutputFile(CREATE_FILE_NAME);
    export.execute(true, false, false, true);
    File file = new File(CREATE_FILE_NAME);
    assertThat(file.lastModified()).as("the file should be generated").isGreaterThan(now);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号