ORMAutoAssemble ormaa = pojoClazz.getAnnotation(ORMAutoAssemble.class);
if (ormaa == null) {
throw new IllegalAccessException("It not a ORMAutoAssemble Class!");
}
ORMTable ormTable = pojoClazz.getAnnotation(ORMTable.class);
if (ormTable == null) {
throw new IllegalAccessException("It not a ORMTable Class!");
}
ORMHash ormHashTable = pojoClazz.getAnnotation(ORMHash.class);
String refCol = ormHashTable.hashRefColumn();
Map<String, Map<String, List<Object>>> tableArgsMap = new HashMap<String, Map<String,List<Object>>>();
// 装填 散列列
for (String colKey : argsMap.keySet()) {
if (colKey.equals(refCol)) {
// 参照列拆分
Object[] args = argsMap.get(colKey);
for (Object colValue : args) {
String tableName = DBUtils.getInstance().findHashTableName(ormHashTable, ormTable, Long.valueOf(String.valueOf(colValue)));
if (tableArgsMap.get(tableName) == null) {
Map<String, List<Object>> m = new HashMap<String, List<Object>>();
List<Object> l = new ArrayList<Object>();
l.add(colValue);
m.put(colKey, l);
tableArgsMap.put(tableName, m);
} else {
tableArgsMap.get(tableName).get(colKey).add(colValue);
}
}
break;
}
}
// 装填其它参数
for (String colKey : argsMap.keySet()) {
if (colKey.equals(refCol)) {
// 这个参数已经拆分完毕
continue;
}
for (Map<String, List<Object>> map : tableArgsMap.values()) {
map.put(colKey, Arrays.asList(argsMap.get(colKey)));
}
}
String[] orders = ormTable.order();
this.sqls = new ArrayList<String>();
this.argsObjs = new ArrayList<Object[]>();
for (String tableName : tableArgsMap.keySet()) {
List<Object> params = new ArrayList<Object>();