jtw3ybtb1#
public int pkHash(DbMapping dbMapping, Map<String, Object> d, Map<String, Object> o) { int hash = 0; // 取主键 for (Map.Entry<String, String> entry : dbMapping.getTargetPk().entrySet()) { String targetColumnName = entry.getKey(); String srcColumnName = entry.getValue(); if (srcColumnName == null) { srcColumnName = Util.cleanColumn(targetColumnName); } Object value = null; if (o != null && o.containsKey(srcColumnName)) { value = o.get(srcColumnName); } else if (d != null) { value = d.get(srcColumnName); } if (value != null) { hash += value.hashCode(); } } hash = Math.abs(hash) % threads; return Math.abs(hash); }
全到0分区里面去
fnvucqvd2#
非常感谢解答
q9rjltbz3#
mark
3条答案
按热度按时间jtw3ybtb1#
全到0分区里面去
fnvucqvd2#
全到0分区里面去
非常感谢解答
q9rjltbz3#
mark