(cond: FilterQuery<TT> = {})
| 460 | } |
| 461 | |
| 462 | private createCondition<TT extends T>(cond: FilterQuery<TT> = {}): FilterQuery<TT> { |
| 463 | if (this.property.kind === ReferenceKind.ONE_TO_MANY) { |
| 464 | // the owning FK may reference a non-PK column (`targetKey`), so match on that value when set |
| 465 | cond[this.property.mappedBy as unknown as FilterKey<TT>] = helper(this.owner).getTargetKeyValue( |
| 466 | this.mappedByProp?.targetKey, |
| 467 | ) as any; |
| 468 | } else { |
| 469 | // MANY_TO_MANY |
| 470 | this.createManyToManyCondition(cond); |
| 471 | } |
| 472 | |
| 473 | return cond; |
| 474 | } |
| 475 | |
| 476 | private createManyToManyCondition<TT extends T>(cond: FilterQuery<TT>) { |
| 477 | const dict = cond as Dictionary; |
no test coverage detected