DefaultPersistManager.java 文件源码

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

项目:gitplex-mit 作者:
protected void dropConstraints(Metadata metadata) {
    File tempFile = null;
    try {
        tempFile = File.createTempFile("schema", ".sql");
        new SchemaExport().setOutputFile(tempFile.getAbsolutePath())
                .setFormat(false).drop(EnumSet.of(TargetType.SCRIPT), metadata);
        List<String> sqls = new ArrayList<>();
        for (String sql: FileUtils.readLines(tempFile)) {
            if (isDroppingConstraints(sql))
                sqls.add(sql);
        }
        execute(sqls, false);
    } catch (IOException e) {
        throw new RuntimeException(e);
    } finally {
        if (tempFile != null)
            tempFile.delete();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号