public static boolean replaceInParent(SQLExpr expr, SQLExpr target) { if (expr == null) { return false; } SQLObject parent = expr.getParent(); if (parent instanceof SQLReplaceable) { return ((SQLReplaceable) parent).replace(expr, target); } return false; }
SQLObject parent = param.getParent(); if (parent != null) { List<SQLObject> mergedList = null;
SQLObject parent = x.getParent(); while (parent != null && !(parent instanceof SQLStatement)) { parent = parent.getParent();
public static boolean replaceInParent(SQLExpr expr, SQLExpr target) { if (expr == null) { return false; } SQLObject parent = expr.getParent(); if (parent instanceof SQLReplaceable) { return ((SQLReplaceable) parent).replace(expr, target); } return false; }
SQLObject parent = param.getParent(); if (parent != null) { List<SQLObject> mergedList = null;
SQLObject parent = x.getParent(); while (parent != null && !(parent instanceof SQLStatement)) { parent = parent.getParent();
private static void doFormatWhere(SQLExpr sqlExpr) { String itemStr; if (sqlExpr instanceof SQLBetweenExpr) { itemStr = ((SQLBetweenExpr) sqlExpr).getBeginExpr().toString() + ((SQLBetweenExpr) sqlExpr).getEndExpr().toString(); } else if (sqlExpr instanceof SQLInListExpr) { itemStr = ((SQLInListExpr) sqlExpr).getTargetList().toString(); } else { itemStr = sqlExpr.toString(); } if (FIELD_PLACE_HOLDER_PATTERN.matcher(itemStr).find()) { if (sqlExpr.getParent() instanceof SQLBinaryOpExpr) { ((SQLBinaryOpExpr) sqlExpr.getParent()).replace(sqlExpr, null); } else if (sqlExpr.getParent() instanceof SQLSelectQueryBlock) { ((SQLSelectQueryBlock) sqlExpr.getParent()).replace(sqlExpr, null); } } }
private static void doFormatWhere(SQLExpr sqlExpr) { String itemStr; if (sqlExpr instanceof SQLBetweenExpr) { itemStr = ((SQLBetweenExpr) sqlExpr).getBeginExpr().toString() + ((SQLBetweenExpr) sqlExpr).getEndExpr().toString(); } else if (sqlExpr instanceof SQLInListExpr) { itemStr = ((SQLInListExpr) sqlExpr).getTargetList().toString(); } else { itemStr = sqlExpr.toString(); } if (FIELD_PLACE_HOLDER_PATTERN.matcher(itemStr).find()) { if (sqlExpr.getParent() instanceof SQLBinaryOpExpr) { ((SQLBinaryOpExpr) sqlExpr.getParent()).replace(sqlExpr, null); } else if (sqlExpr.getParent() instanceof SQLSelectQueryBlock) { ((SQLSelectQueryBlock) sqlExpr.getParent()).replace(sqlExpr, null); } } }