@Test public void testExpressionForKey() { Map<String, Object> key = new HashMap<>(); key.put("a", "a1"); key.put("b", 5); Expression e = mapper.expressionForKey(key); assertEquals(ExpressionFactory.exp("a = 'a1' and b = 5"), e); }
@Override public Expression expressionForKey(Object key) { Map<String, Object> keyMap = (Map<String, Object>) key; List<Expression> clauses = new ArrayList<>(pathMappers.size()); for (Entry<String, Mapper> e : pathMappers.entrySet()) { Object value = keyMap.get(e.getKey()); clauses.add(e.getValue().expressionForKey(value)); } return joinExp(Expression.AND, clauses); }
MultiPathMapper implements Mapper { @Override public Expression expressionForKey(Object key) { Map<String, Object> keyMap = (Map<String, Object>) key; List<Expression> clauses = new ArrayList<>(pathMappers.size()); for (Entry<String, Mapper> e : pathMappers.entrySet()) { Object value = keyMap.get(e.getKey()); clauses.add(e.getValue().expressionForKey(value)); } return joinExp(Expression.AND, clauses); } }
MultiPathMapper implements Mapper { @Override public Expression expressionForKey(Object key) { Map<String, Object> keyMap = (Map<String, Object>) key; List<Expression> clauses = new ArrayList<>(pathMappers.size()); for (Entry<String, Mapper> e : pathMappers.entrySet()) { Object value = keyMap.get(e.getKey()); clauses.add(e.getValue().expressionForKey(value)); } return joinExp(Expression.AND, clauses); } MultiPathMapper(Map<String, Mapper> pathMappers); }
MultiPathMapper implements Mapper { @Override public Expression expressionForKey(Object key) { Map<String, Object> keyMap = (Map<String, Object>) key; List<Expression> clauses = new ArrayList<>(pathMappers.size()); for (Entry<String, Mapper> e : pathMappers.entrySet()) { Object value = keyMap.get(e.getKey()); clauses.add(e.getValue().expressionForKey(value)); } return joinExp(Expression.AND, clauses); } MultiPathMapper(Map<String, Mapper> pathMappers); @Override Expression expressionForKey(Object key); @Override Object keyForSource(RowProxy source); @Override Object keyForTarget(DataObject target); }
MultiPathMapper implements Mapper { @Override public Expression expressionForKey(Object key) { Map<String, Object> keyMap = (Map<String, Object>) key; List<Expression> clauses = new ArrayList<>(pathMappers.size()); for (Entry<String, Mapper> e : pathMappers.entrySet()) { Object value = keyMap.get(e.getKey()); clauses.add(e.getValue().expressionForKey(value)); } return joinExp(Expression.AND, clauses); } MultiPathMapper(Map<String, Mapper> pathMappers); @Override Expression expressionForKey(Object key); @Override Object keyForSource(RowProxy source); @Override Object keyForTarget(DataObject target);  }