@Test public void testNullMergeCriteria() { List<Criteria> criteriaMerged = mongoQueryConverter.mergeCriteria(null); assertNotNull("Should not be null", criteriaMerged); assertEquals("Should match", 0, criteriaMerged.size()); }
protected List<Criteria> mergeCriteria(Map<String, List<NeutralCriteria>> criteriaForFields) { LOG.debug(">>>MongoQueryConverter.mergeCriteria()"); List<Criteria> criteriaList = new ArrayList<Criteria>(); if (criteriaForFields != null) { for (Map.Entry<String, List<NeutralCriteria>> e : criteriaForFields.entrySet()) { List<NeutralCriteria> list = e.getValue(); if (list != null) { Criteria fullCriteria = null; for (NeutralCriteria criteria : list) { fullCriteria = operatorImplementations.get( criteria.getOperator()).generateCriteria(criteria, fullCriteria); } criteriaList.add(fullCriteria); } } } return criteriaList; }
MongoQueryConverter { protected List<Criteria> mergeCriteria(Map<String, List<NeutralCriteria>> criteriaForFields) { LOG.debug(">>>MongoQueryConverter.mergeCriteria()"); List<Criteria> criteriaList = new ArrayList<Criteria>(); if (criteriaForFields != null) { for (Map.Entry<String, List<NeutralCriteria>> e : criteriaForFields.entrySet()) { List<NeutralCriteria> list = e.getValue(); if (list != null) { Criteria fullCriteria = null; for (NeutralCriteria criteria : list) { fullCriteria = operatorImplementations.get( criteria.getOperator()).generateCriteria(criteria, fullCriteria); } criteriaList.add(fullCriteria); } } } return criteriaList; } }
MongoQueryConverter { protected List<Criteria> mergeCriteria(Map<String, List<NeutralCriteria>> criteriaForFields) { LOG.debug(">>>MongoQueryConverter.mergeCriteria()"); List<Criteria> criteriaList = new ArrayList<Criteria>(); if (criteriaForFields != null) { for (Map.Entry<String, List<NeutralCriteria>> e : criteriaForFields.entrySet()) { List<NeutralCriteria> list = e.getValue(); if (list != null) { Criteria fullCriteria = null; for (NeutralCriteria criteria : list) { fullCriteria = operatorImplementations.get( criteria.getOperator()).generateCriteria(criteria, fullCriteria); } criteriaList.add(fullCriteria); } } } return criteriaList; } MongoQueryConverter(); }
MongoQueryConverter { protected List<Criteria> mergeCriteria(Map<String, List<NeutralCriteria>> criteriaForFields) { LOG.debug(">>>MongoQueryConverter.mergeCriteria()"); List<Criteria> criteriaList = new ArrayList<Criteria>(); if (criteriaForFields != null) { for (Map.Entry<String, List<NeutralCriteria>> e : criteriaForFields.entrySet()) { List<NeutralCriteria> list = e.getValue(); if (list != null) { Criteria fullCriteria = null; for (NeutralCriteria criteria : list) { fullCriteria = operatorImplementations.get( criteria.getOperator()).generateCriteria(criteria, fullCriteria); } criteriaList.add(fullCriteria); } } } return criteriaList; } MongoQueryConverter(); Query convert(String entityName, NeutralQuery neutralQuery); Query convert(String entityName, NeutralQuery neutralQuery, boolean allFields); List<Criteria> convertToCriteria(String entityName, NeutralQuery neutralQuery, NeutralSchema entitySchema); }
MongoQueryConverter { protected List<Criteria> mergeCriteria(Map<String, List<NeutralCriteria>> criteriaForFields) { LOG.debug(">>>MongoQueryConverter.mergeCriteria()"); List<Criteria> criteriaList = new ArrayList<Criteria>(); if (criteriaForFields != null) { for (Map.Entry<String, List<NeutralCriteria>> e : criteriaForFields.entrySet()) { List<NeutralCriteria> list = e.getValue(); if (list != null) { Criteria fullCriteria = null; for (NeutralCriteria criteria : list) { fullCriteria = operatorImplementations.get( criteria.getOperator()).generateCriteria(criteria, fullCriteria); } criteriaList.add(fullCriteria); } } } return criteriaList; } MongoQueryConverter(); Query convert(String entityName, NeutralQuery neutralQuery); Query convert(String entityName, NeutralQuery neutralQuery, boolean allFields); List<Criteria> convertToCriteria(String entityName, NeutralQuery neutralQuery, NeutralSchema entitySchema);  }