private Expression translate(RexNode expr) { Slot slot = map.get(expr); if (slot == null) { Expression expression = translate0(expr); assert expression != null; final ParameterExpression parameter; if (!inlineRexSet.contains(expr) && !(expr instanceof RexLocalRef)) { parameter = Expressions.parameter(expression.getType(), "v" + map.size()); } else { parameter = null; } slot = new Slot(parameter, expression); if (parameter != null && list != null) { list.add(Expressions.declare(Modifier.FINAL, slot.parameterExpression, slot.expression)); } map.put(expr, slot); } slot.count++; return slot.parameterExpression != null ? slot.parameterExpression : slot.expression; }
static { for (Map.Entry<Method, SqlOperator> entry : JAVA_TO_SQL_METHOD_MAP.entrySet()) { SQL_OP_TO_JAVA_METHOD_MAP.put(entry.getValue(), entry.getKey()); } }