while(rs.next()){
UUID id = DataAccessFactory.getInstance().createUUID(rs.getObject("id").toString());
String createUser = rs.getString("create_user");
Timestamp createTime = rs.getTimestamp("create_time");
Filter filter = new FilterImpl(id, createUser, createTime, null);
filter.setName(rs.getString("name"));
filter.setXml(rs.getString("xml"));
filter.setAnd(rs.getBoolean("is_and"));
filter.setPublic(rs.getBoolean("is_public"));
filter.setVisible(rs.getBoolean("is_visible"));
filterList.add(filter);
}
}
catch(Exception e){
e.printStackTrace();
}
finally{
DbPoolConnection.getInstance().closeResultSet(rs);
DbPoolConnection.getInstance().closeStatment(pstm);
DbPoolConnection.getInstance().closeConn(conn);
}
Map<UUID, Boolean> templateAllowMap = new HashMap<UUID, Boolean>();
Map<UUID, List<Template>> allTemplateTypeMap = new HashMap<UUID, List<Template>>();
Map<UUID, Template> allTemplateMap = new HashMap<UUID, Template>();
Map<UUID, Flow> allFlowMap = new HashMap<UUID, Flow>();
Iterator<Filter> filterItr = filterList.iterator();
while(filterItr.hasNext()){
Filter filter = filterItr.next();
Document xmlDoc = null;
try{
xmlDoc = XMLUtil.string2Document(filter.getXml(), "UTF-8");
}
catch(Exception e){
e.printStackTrace();
System.err.println("error filter id: " + filter.getId());
}
if(xmlDoc == null){
filterItr.remove();
continue;