hunk.code_window:         });
       }
       public static joinEagerRelations(qb: SelectQueryBuilder<any>, alias: string, metadata: EntityMetadata) {
           metadata.eagerRelations.forEach(relation => {
               const relationAlias = alias + "_" + relation.propertyPath.replace(".", "_");
               qb.leftJoinAndSelect(alias + "." + relation.propertyPath, relationAlias);
               this.joinEagerRelations(qb, relationAlias, relation.inverseEntityMetadata);
           });
       }
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep
hunk.after_edit:             const relationAlias = qb.connection.namingStrategy.eagerJoinRelationAlias(alias, relation.propertyPath);
  
hunk.file_path: src/find-options/FindOptionsUtils.ts
hunk.type: replace
file: # 使用 Query Builder 更新
  
  你可以使用`QueryBuilder`创建`UPDATE`查询。
  例如：
  
  ```typescript
  import { getConnection } from "typeorm";
  
  await getConnection()
    .createQueryBuilder()
    .update(User)
    .set({ firstName: "Timber", lastName: "Saw" })
    .where("id = :id", { id: 1 })
    .execute();
  ```
  
  就性能而言，这是更新数据库中的实体的最有效方法。
  
  ### 原始SQL支持
  
   在某些情况下需要执行函数SQL查询时：
  
  
   ```typescript
  import {getConnection} from "typeorm";
   await getConnection()
      .createQueryBuilder()
      .update(User)
      .set({ 
          firstName: "Timber", 
          lastName: "Saw",
          age: () => "'age' + 1"
      })
      .where("id = :id", { id: 1 })
      .execute();
  ```
  
   此语法不会对值进行转义，你需要自己处理转义。
  