Search in sources :

Example 1 with AstConcatExpression

use of com.developmentontheedge.sql.model.AstConcatExpression in project be5 by DevelopmentOnTheEdge.

the class DB2Transformer method transformString.

@Override
protected void transformString(AstStringConstant string) {
    for (AstStringPart child : string.children().select(AstStringPart.class)) {
        String content = child.getContent().replace("\\'", "''");
        child.setContent(string.isEscape() ? content.replaceAll("\\\\([^bfnrt])", "$1") : content, true);
    }
    if (string.isEscape()) {
        string.setEscape(false);
        AstConcatExpression concat = new AstConcatExpression(SqlParserTreeConstants.JJTCONCATEXPRESSION);
        if (replacedEscapes(string, concat))
            string.replaceWith(concat);
    }
}
Also used : AstConcatExpression(com.developmentontheedge.sql.model.AstConcatExpression) AstStringPart(com.developmentontheedge.sql.model.AstStringPart)

Example 2 with AstConcatExpression

use of com.developmentontheedge.sql.model.AstConcatExpression in project be5 by DevelopmentOnTheEdge.

the class OracleTransformer method transformString.

@Override
protected void transformString(AstStringConstant string) {
    for (AstStringPart child : string.children().select(AstStringPart.class)) {
        String content = child.getContent().replace("\\'", "''");
        child.setContent(string.isEscape() ? content.replaceAll("\\\\([^bfnrt])", "$1") : content, true);
    }
    if (string.isEscape()) {
        string.setEscape(false);
        AstConcatExpression concat = new AstConcatExpression(SqlParserTreeConstants.JJTCONCATEXPRESSION);
        if (replacedEscapes(string, concat))
            string.replaceWith(concat);
    }
}
Also used : AstConcatExpression(com.developmentontheedge.sql.model.AstConcatExpression) AstStringPart(com.developmentontheedge.sql.model.AstStringPart)

Aggregations

AstConcatExpression (com.developmentontheedge.sql.model.AstConcatExpression)2 AstStringPart (com.developmentontheedge.sql.model.AstStringPart)2