Seq.java 文件源码

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

项目:olca-modules 作者:
private void initType(ModelType type) {
    Table table = type.getModelClass().getAnnotation(Table.class);
    String query = "select id, ref_id from " + table.name();
    HashMap<String, Long> seq = new HashMap<>();
    HashSet<String> inDb = new HashSet<>();
    try {
        NativeSql.on(db).query(query, result -> {
            String refId = result.getString(2);
            seq.put(refId, result.getLong(1));
            inDb.add(refId);
            return true;
        });
    } catch (Exception e) {
        log.error("failed to initialize sequence map for " + type, e);
    }
    sequences[type.ordinal()] = seq;
    inDatabase[type.ordinal()] = inDb;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号