@Override
    public String serialize(String literal, int jdbcType) {
        switch (jdbcType) {
            case Types.TIMESTAMP:
                return "CAST('" + literal + "' AS DATETIME2)";
            case TIMESTAMP_WITH_TIMEZONE:
                return "CAST('" + literal + "' AS DATETIMEOFFSET)";
            case Types.DATE:
                return "CAST('" + literal + "' AS DATE)";
            case Types.TIME:
            case TIME_WITH_TIMEZONE:
                return "CAST('" + literal + "' AS TIME)";
            default:
                return super.serialize(literal, jdbcType);
        }
    }
{@code SQLServerTemplates} is an SQL dialect for Microsoft SQL Server

@author tiwe
querydsl-sql/src/main/java/com/querydsl/sql/SQLServerTemplates.java