MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / hasToManyJoins

Function hasToManyJoins

packages/sql/src/AbstractSqlDriver.ts:304–317  ·  view source on GitHub ↗
(hint: PopulateOptions<T>, meta: EntityMetadata<T>)

Source from the content-addressed store, hash-verified

302 }
303
304 protected hasToManyJoins<T extends object>(hint: PopulateOptions<T>, meta: EntityMetadata<T>): boolean {
305 const [propName] = hint.field.split(':', 2) as [EntityKey<T>];
306 const prop = meta.properties[propName];
307
308 if (prop && [ReferenceKind.ONE_TO_MANY, ReferenceKind.MANY_TO_MANY].includes(prop.kind)) {
309 return true;
310 }
311
312 if (hint.children && prop.targetMeta) {
313 return hint.children.some(hint => this.hasToManyJoins(hint as any, prop.targetMeta as any));
314 }
315
316 return false;
317 }
318
319 override async findVirtual<T extends object>(
320 entityName: EntityName<T>,

Callers

nothing calls this directly

Calls 1

hasToManyJoinsMethod · 0.80

Tested by

no test coverage detected