protected SqlWhereVisitor getSqlWhereVisitor() { if (visitor == null) { visitor = new SqlWhereVisitor(); visit(where, visitor); } return visitor; }
public void visitConstantExpression(ConstantExpression expression) { getParameters().add(expression.getValue()); buffer.append("?"); }
private String getSqlWhere() { String whereClaus = ""; String parentClaus = ""; if (parent != null) { parentClaus = parent.getSqlWhere(); } if (where != null) { whereClaus += getSqlWhereVisitor().getWhere(); } if (parentClaus.length() == 0) return whereClaus; if (whereClaus.length() == 0) return parentClaus; return parentClaus + " and " + whereClaus; }
public void visitBinaryExpression(BinaryExpression expression) { Expression left = expression.getLeftExpression(); Expression right = expression.getRightExpression(); boolean leaf = (right instanceof ConstantExpression || left instanceof ConstantExpression); if (!leaf) buffer.append("("); left.visit(this); buffer.append(" "); Token token = expression.getOperation(); buffer.append(tokenAsSql(token)); buffer.append(" "); right.visit(this); if (!leaf) buffer.append(")"); }
public void visitBinaryExpression(BinaryExpression expression) { Expression left = expression.getLeftExpression(); Expression right = expression.getRightExpression(); boolean leaf = (right instanceof ConstantExpression || left instanceof ConstantExpression); if (!leaf) buffer.append("("); left.visit(this); buffer.append(" "); Token token = expression.getOperation(); buffer.append(tokenAsSql(token)); buffer.append(" "); right.visit(this); if (!leaf) buffer.append(")"); }
public List<Object> getParameters() { if (params == null) { params = new ArrayList<Object>(); if (parent != null) { params.addAll(parent.getParameters()); } params.addAll(getSqlWhereVisitor().getParameters()); } return params; }
protected SqlWhereVisitor getSqlWhereVisitor() { if (visitor == null) { visitor = new SqlWhereVisitor(); visit(where, visitor); } return visitor; }
public void visitBinaryExpression(BinaryExpression expression) { Expression left = expression.getLeftExpression(); Expression right = expression.getRightExpression(); boolean leaf = (right instanceof ConstantExpression); if (!leaf) buffer.append("("); left.visit(this); buffer.append(" "); Token token = expression.getOperation(); buffer.append(tokenAsSql(token)); buffer.append(" "); right.visit(this); if (!leaf) buffer.append(")"); }
private String getSqlWhere() { String whereClaus = ""; String parentClaus = ""; if (parent != null) { parentClaus = parent.getSqlWhere(); } if (where != null) { whereClaus += getSqlWhereVisitor().getWhere(); } if (parentClaus.length() == 0) return whereClaus; if (whereClaus.length() == 0) return parentClaus; return parentClaus + " and " + whereClaus; }
public void visitConstantExpression(ConstantExpression expression) { getParameters().add(expression.getValue()); buffer.append("?"); }
protected SqlWhereVisitor getSqlWhereVisitor() { if (visitor == null) { visitor = new SqlWhereVisitor(); visit(where, visitor); } return visitor; }
public void visitBinaryExpression(BinaryExpression expression) { Expression left = expression.getLeftExpression(); Expression right = expression.getRightExpression(); boolean leaf = (right instanceof ConstantExpression || left instanceof ConstantExpression); if (!leaf) buffer.append("("); left.visit(this); buffer.append(" "); Token token = expression.getOperation(); buffer.append(tokenAsSql(token)); buffer.append(" "); right.visit(this); if (!leaf) buffer.append(")"); }
private String getSqlWhere() { String whereClaus = ""; String parentClaus = ""; if (parent != null) { parentClaus = parent.getSqlWhere(); } if (where != null) { whereClaus += getSqlWhereVisitor().getWhere(); } if (parentClaus.length() == 0) return whereClaus; if (whereClaus.length() == 0) return parentClaus; return parentClaus + " and " + whereClaus; }
public void visitConstantExpression(ConstantExpression expression) { getParameters().add(expression.getValue()); buffer.append("?"); }
protected SqlWhereVisitor getSqlWhereVisitor() { if (visitor == null) { visitor = new SqlWhereVisitor(); visit(where, visitor); } return visitor; }
public void visitBinaryExpression(BinaryExpression expression) { Expression left = expression.getLeftExpression(); Expression right = expression.getRightExpression(); boolean leaf = (right instanceof ConstantExpression); if (!leaf) buffer.append("("); left.visit(this); buffer.append(" "); Token token = expression.getOperation(); buffer.append(tokenAsSql(token)); buffer.append(" "); right.visit(this); if (!leaf) buffer.append(")"); }
private String getSqlWhere() { String whereClaus = ""; String parentClaus = ""; if (parent != null) { parentClaus = parent.getSqlWhere(); } if (where != null) { whereClaus += getSqlWhereVisitor().getWhere(); } if (parentClaus.length() == 0) return whereClaus; if (whereClaus.length() == 0) return parentClaus; return parentClaus + " and " + whereClaus; }
public void visitConstantExpression(ConstantExpression expression) { getParameters().add(expression.getValue()); buffer.append("?"); }
protected SqlWhereVisitor getSqlWhereVisitor() { if (visitor == null) { visitor = new SqlWhereVisitor(); visit(where, visitor); } return visitor; }
public void visitBinaryExpression(BinaryExpression expression) { Expression left = expression.getLeftExpression(); Expression right = expression.getRightExpression(); boolean leaf = (right instanceof ConstantExpression); if (!leaf) buffer.append("("); left.visit(this); buffer.append(" "); Token token = expression.getOperation(); buffer.append(tokenAsSql(token)); buffer.append(" "); right.visit(this); if (!leaf) buffer.append(")"); }