Exemple #1
0
 /**
  * 根据DefaultPool字段(允许用“,”分隔),获取DBRule中含有指定写库的DBRule
  *
  * @param aVtab
  * @param aVtabMatrix
  * @param tempSet
  * @return
  */
 private List<DBRule> getDefaultRuleList(Element aVtab, LogicTabMatrix aVtabMatrix) {
   List<DBRule> defaultList = new ArrayList<DBRule>();
   String defaultPools = trim(aVtab.attributeValue("defaultWritePool"));
   if (defaultPools != null) {
     String[] defaultPoolsStrArray = defaultPools.split(",");
     Map<String, DBRule> map = aVtabMatrix.getAllRules();
     for (String str : defaultPoolsStrArray) {
       DBRule dbrule = map.get(str.trim());
       if (dbrule != null) {
         defaultList.add(dbrule);
       } else {
         throw new IllegalArgumentException(
             "defaultRule中id为:" + str + " 的字段不能找到" + "一个对应的规则,请确认该id对应一个dbRule的id参数");
       }
     }
   }
   return defaultList;
 }