public String asLiteral(Object constant) {
        if (constant instanceof Boolean) {
            return constant.toString();
        } else if (constant instanceof Number) {
            return constant.toString();
        } else if (constant instanceof String) {
            return "'" + escapeLiteral(constant.toString()) + "'";
        } else if (constant instanceof Enum) {
            return constant.getClass().getName() + "." + ((Enum) constant).name();
        } else {
            return "'" + constant.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