private String escapeLiteral(String str) {
        StringBuilder builder = new StringBuilder();
        for (char ch : str.toCharArray()) {
            if (ch == '\n') {
                builder.append("\\n");
                continue;
            } else if (ch == '\r') {
                builder.append("\\r");
                continue;
            } else if (ch == '\'') {
                builder.append("''");
                continue;
            }
            builder.append(ch);
        }
        return builder.toString();
    }
{@code JPQLTemplates} extends {@link Templates} to provide operator patterns for JPQL
serialization

@author tiwe
@see HQLTemplates
@see EclipseLinkTemplates
querydsl-jpa/src/main/java/com/querydsl/jpa/JPQLTemplates.java