Resolves the logical database schema that owns a query.
Precedence:
Explicit query.SchemaName when present.
Referenced entities in query.Entities or query.Fields (SourceEntityID / SourceEntity):
if any referenced entity belongs to a non-core schema, the most frequent non-core schema
(ties broken alphabetically) wins.
Top-level category segment matching a known non-core schema.
Resolves the logical database schema that owns a query.
Precedence:
query.SchemaNamewhen present.query.Entitiesorquery.Fields(SourceEntityID/SourceEntity): if any referenced entity belongs to a non-core schema, the most frequent non-core schema (ties broken alphabetically) wins.mjCoreSchema('__mj').