Repository: typeorm/typeorm
File: src/query-builder/SelectQueryBuilder.ts (TypeScript)

Code before:
                        propertyPath,
                        metadata,
                    )

                if (column) {
                    let aliasPath = `${alias}.${propertyPath}`
                    if (column.isVirtualProperty && column.query) {
                        aliasPath = `(${column.query(alias)})`
                    }
                    // const parameterName = alias + "_" + propertyPath.split(".").join("_") + "_" + parameterIndex;

                    // todo: we need to handle other operators as well?
                    let parameterValue = where[key]
                    if (InstanceChecker.isEqualOperator(where[key])) {
                        parameterValue = where[key].value
                    }

                    if (column.transformer) {
                        parameterValue instanceof FindOperator
                            ? parameterValue.transformValue(column.transformer)
                            : (parameterValue =
                                  ApplyValueTransformers.transformTo(
                                      column.transformer,
                                      parameterValue,
                                  ))
                    } else {
                        if (this.connection.driver.options.type === "mssql") {
                            parameterValue = (
                                this.connection.driver as SqlServerDriver
                            ).parametrizeValue(column, parameterValue)
                        }
                    }

                    // if (parameterValue === null) {
                    //     andConditions.push(`${aliasPath} IS NULL`);
                    //
                    // } else if (parameterValue instanceof FindOperator) {
                    //     // let parameters: any[] = [];
                    //     // if (parameterValue.useParameter) {
                    //     //     const realParameterValues: any[] = parameterValue.multipleParameters ? parameterValue.value : [parameterValue.value];
                    //     //     realParameterValues.forEach((realParameterValue, realParameterValueIndex) => {
                    //     //
                    //     //         // don't create parameters for number to prevent max number of variables issues as much as possible
                    //     //         if (typeof realParameterValue === "number") {
                    //     //             parameters.push(realParameterValue);
                    //     //
                    //     //         } else {
                    //     //             this.expressionMap.nativeParameters[parameterName + realParameterValueIndex] = realParameterValue;
                    //     //             parameterIndex++;
                    //     //             parameters.push(this.connection.driver.createParameter(parameterName + realParameterValueIndex, parameterIndex - 1));
                    //     //         }

Review comment (suggestion):
Are you sure this path should be in the else branch here?

I think the value needs to be 'parametrized' [sic] regardless of whether the column has a value transformer or not. The transformer should be applied first, and then parameterization.

Code after:
                        propertyPath,
                        metadata,
                    )

                if (column) {
                    let aliasPath = `${alias}.${propertyPath}`
                    if (column.isVirtualProperty && column.query) {
                        aliasPath = `(${column.query(alias)})`
                    }
                    // const parameterName = alias + "_" + propertyPath.split(".").join("_") + "_" + parameterIndex;

                    // todo: we need to handle other operators as well?
                    let parameterValue = where[key]
                    if (InstanceChecker.isEqualOperator(where[key])) {
                        parameterValue = where[key].value
                    }

                    if (column.transformer) {
                        parameterValue instanceof FindOperator
                            ? parameterValue.transformValue(column.transformer)
                            : (parameterValue =
                                  ApplyValueTransformers.transformTo(
                                      column.transformer,
                                      parameterValue,
                                  ))
                    }

                    // MSSQL requires parameters to carry extra type information
                    if (this.connection.driver.options.type === "mssql") {
                        const driver = this.connection.driver as SqlServerDriver
                        if (parameterValue instanceof FindOperator) {
                            if (parameterValue.type !== "raw") {
                                parameterValue.transformValue({
                                    to: (v) =>
                                        driver.parametrizeValue(column, v),
                                    from: (v) => v,
                                })
                            }
                        } else {
                            parameterValue = driver.parametrizeValue(
                                column,
                                parameterValue,
                            )
                        }
                    }

                    // if (parameterValue === null) {
                    //     andConditions.push(`${aliasPath} IS NULL`);
                    //
                    // } else if (parameterValue instanceof FindOperator) {
                    //     // let parameters: any[] = [];