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;
}
Seq.java 文件源码
java
阅读 43
收藏 0
点赞 0
评论 0
项目:olca-modules
作者:
评论列表
文章目录