* Find the alias for a TPT child table in the query builder. * @internal
(qb: AnyQueryBuilder<T>, childMeta: EntityMetadata)
| 2772 | * @internal |
| 2773 | */ |
| 2774 | protected findTPTChildAlias<T extends object>(qb: AnyQueryBuilder<T>, childMeta: EntityMetadata): string | undefined { |
| 2775 | const joins = qb.state.joins as Dictionary; |
| 2776 | for (const key of Object.keys(joins)) { |
| 2777 | if (joins[key].table === childMeta.tableName && key.includes('[tpt]')) { |
| 2778 | return joins[key].alias; |
| 2779 | } |
| 2780 | } |
| 2781 | return undefined; |
| 2782 | } |
| 2783 | |
| 2784 | /** |
| 2785 | * Builds a CASE WHEN expression for TPT discriminator. |