@Test public void testGetParameterNamesWithFilledQueriesMap() { String param = "param"; String qualifierString = "name = $" + param; SelectQueryDescriptor selectQueryDescriptor = new SelectQueryDescriptor(); Set<String> result = new LinkedHashSet<>(); assertEquals(result, dataMapUtils.getParameterNames(selectQueryDescriptor)); Expression exp = ExpressionFactory.exp(qualifierString); selectQueryDescriptor.setQualifier(exp); selectQueryDescriptor.setName("name"); Map<String, String> map = new HashMap<>(); map.put(param, "java.lang.String"); dataMapUtils.queriesMap.put("name", map); Collection collection = dataMapUtils.getParameterNames(selectQueryDescriptor); result.add(param); assertEquals(collection, result); }
public Collection getParameterNames(SelectQueryDescriptor query) { if (query.getQualifier() == null) { return Collections.EMPTY_SET; } Map<String, String> queryParameters = queriesMap.get(query.getName()); if (queryParameters == null) { queryParameters = getParameterNames(query.getQualifier(), query.getRoot()); queriesMap.put(query.getName(), queryParameters); } return parseQualifier(query.getQualifier().toString()); }
DataMapUtils { public Collection getParameterNames(SelectQueryDescriptor query) { if (query.getQualifier() == null) { return Collections.EMPTY_SET; } Map<String, String> queryParameters = queriesMap.get(query.getName()); if (queryParameters == null) { queryParameters = getParameterNames(query.getQualifier(), query.getRoot()); queriesMap.put(query.getName(), queryParameters); } return parseQualifier(query.getQualifier().toString()); } }
DataMapUtils { public Collection getParameterNames(SelectQueryDescriptor query) { if (query.getQualifier() == null) { return Collections.EMPTY_SET; } Map<String, String> queryParameters = queriesMap.get(query.getName()); if (queryParameters == null) { queryParameters = getParameterNames(query.getQualifier(), query.getRoot()); queriesMap.put(query.getName(), queryParameters); } return parseQualifier(query.getQualifier().toString()); }  }
DataMapUtils { public Collection getParameterNames(SelectQueryDescriptor query) { if (query.getQualifier() == null) { return Collections.EMPTY_SET; } Map<String, String> queryParameters = queriesMap.get(query.getName()); if (queryParameters == null) { queryParameters = getParameterNames(query.getQualifier(), query.getRoot()); queriesMap.put(query.getName(), queryParameters); } return parseQualifier(query.getQualifier().toString()); }  String getQueryMethodName(QueryDescriptor query); Collection getParameterNames(SelectQueryDescriptor query); Boolean isValidParameterNames(SelectQueryDescriptor query); boolean hasParameters(SelectQueryDescriptor query); String getParameterType(SelectQueryDescriptor query, String name); }
DataMapUtils { public Collection getParameterNames(SelectQueryDescriptor query) { if (query.getQualifier() == null) { return Collections.EMPTY_SET; } Map<String, String> queryParameters = queriesMap.get(query.getName()); if (queryParameters == null) { queryParameters = getParameterNames(query.getQualifier(), query.getRoot()); queriesMap.put(query.getName(), queryParameters); } return parseQualifier(query.getQualifier().toString()); }  String getQueryMethodName(QueryDescriptor query); Collection getParameterNames(SelectQueryDescriptor query); Boolean isValidParameterNames(SelectQueryDescriptor query); boolean hasParameters(SelectQueryDescriptor query); String getParameterType(SelectQueryDescriptor query, String name);  }