MssqlRelation<TParent, TChild> class
One relation between two tables, derived from a foreign key.
Generated code declares these; nothing here is guessed at runtime.
- Annotations
-
- @immutable
Constructors
-
MssqlRelation({required String name, required MssqlRelationKind kind, required MssqlTableBinding<
TChild> targetBinding, required List<String> localColumns, required List<String> foreignColumns, List<MssqlOrder> orderBy = const <MssqlOrder>[], List<MssqlCondition> where = const <MssqlCondition>[], List<MssqlRelation< nested = const [], int? perParentLimit, int? rowLimit, MssqlIncludeStrategy strategy = MssqlIncludeStrategy.batch, MssqlScopeSelection scope = const MssqlScopeSelection.empty(), MssqlRelationThrough? through, MssqlMorph? morph})TChild, Object?> >
Properties
-
asInclude
→ MssqlRelation<
TParent, Object?> -
Same handle with the child type forgotten.
no setter
-
foreignColumns
→ List<
String> -
Columns on the target.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isToOne → bool
-
no setter
- kind → MssqlRelationKind
-
final
-
localColumns
→ List<
String> -
Columns on the parent, paired positionally with foreignColumns.
final
- morph → MssqlMorph?
-
The type/id columns, for the polymorphic shapes.
final
- name → String
-
The field name on the parent row.
final
- needsMorph → bool
-
no setter
- needsThrough → bool
-
no setter
-
nested
→ List<
MssqlRelation< TChild, Object?> > -
Relations to load one level further down.
final
-
orderBy
→ List<
MssqlOrder> -
How to order the loaded children. Meaningless for a to-one relation.
final
- perParentLimit → int?
-
Per-parent ceiling, applied with
ROW_NUMBER() OVER (PARTITION BY …).final - rowLimit → int?
-
A ceiling on the whole load, not per parent.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scope → MssqlScopeSelection
-
Target (and pivot) scope selection: trash and named scopes.
final
- strategy → MssqlIncludeStrategy
-
MssqlIncludeStrategy.batch unless a to-one caller asked for a join.
final
-
targetBinding
→ MssqlTableBinding<
TChild> -
What to read the other side out of.
final
- through → MssqlRelationThrough?
-
The middle table, for the shapes that have one.
final
-
where
→ List<
MssqlCondition> -
Extra predicates on the target (and, for through, not on the pivot).
final
Methods
-
filtered(
List< MssqlCondition> extra) → MssqlRelation<TParent, TChild> - This relation with extra target predicates, ANDed.
-
joined(
) → MssqlRelation< TParent, TChild> -
Explicit to-one LEFT JOIN instead of
IN (…)batching. -
maxLoadedRows(
int rows) → MssqlRelation< TParent, TChild> - Ceiling on the whole load. Hitting it is truncated, not a short list.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onlyTrashed(
) → MssqlRelation< TParent, TChild> - Target scope: only soft-deleted children.
-
ordered(
List< MssqlOrder> terms) → MssqlRelation<TParent, TChild> - This relation with an ordering.
-
select(
List< MssqlExpression> _) → MssqlRelation<TParent, TChild> -
Entity include always maps a full child row. A DTO belongs on the
parent query's select, not here: dropping columns would make
fromRowinvent nulls for fields the SELECT never returned. -
takePerParent(
int rows) → MssqlRelation< TParent, TChild> -
Per-parent limit via
ROW_NUMBER() OVER (PARTITION BY fk …). -
then<
TNested> (MssqlRelation< TChild, TNested> relation) → MssqlRelation<TParent, TChild> - This relation, then one of the target's own.
-
toString(
) → String -
A string representation of this object.
override
-
withNested(
Iterable< MssqlRelation< relations) → MssqlRelation<TChild, Object?> >TParent, TChild> - Nested includes of the target, merged with any already present.
-
withTrashed(
) → MssqlRelation< TParent, TChild> - Target scope: include soft-deleted children.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited