@memberjunction/core 4.4.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generic/baseEntity.d.ts +92 -4
- package/dist/generic/baseEntity.d.ts.map +1 -1
- package/dist/generic/baseEntity.js +163 -23
- package/dist/generic/baseEntity.js.map +1 -1
- package/dist/generic/entityInfo.d.ts +17 -0
- package/dist/generic/entityInfo.d.ts.map +1 -1
- package/dist/generic/entityInfo.js +19 -0
- package/dist/generic/entityInfo.js.map +1 -1
- package/dist/generic/interfaces.d.ts +20 -0
- package/dist/generic/interfaces.d.ts.map +1 -1
- package/dist/generic/interfaces.js.map +1 -1
- package/dist/generic/metadata.d.ts +5 -5
- package/dist/generic/metadata.js +5 -5
- package/dist/generic/metadata.js.map +1 -1
- package/dist/views/runView.js +1 -1
- package/dist/views/runView.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +37 -2
|
@@ -270,20 +270,55 @@ export declare abstract class BaseEntity<T = unknown> {
|
|
|
270
270
|
*
|
|
271
271
|
* All data routing (Set/Get), dirty tracking, validation, and save/delete
|
|
272
272
|
* orchestration flow through this composition chain.
|
|
273
|
+
*
|
|
274
|
+
* ## Disjoint vs Overlapping Subtypes
|
|
275
|
+
*
|
|
276
|
+
* Two modes of child relationship exist, controlled by the parent entity's
|
|
277
|
+
* `AllowMultipleSubtypes` flag:
|
|
278
|
+
*
|
|
279
|
+
* **Disjoint (AllowMultipleSubtypes = false, default):**
|
|
280
|
+
* A parent record has at most ONE child type. _childEntity holds a live
|
|
281
|
+
* BaseEntity reference for composition chaining — save/delete delegates
|
|
282
|
+
* down to the leaf, and LeafEntity traverses through it.
|
|
283
|
+
* Product → _childEntity = MeetingEntity → _childEntity = WebinarEntity
|
|
284
|
+
*
|
|
285
|
+
* **Overlapping (AllowMultipleSubtypes = true):**
|
|
286
|
+
* A parent record can simultaneously exist as MULTIPLE child types.
|
|
287
|
+
* _childEntity is NOT used (ISAChild returns null). Instead,
|
|
288
|
+
* _childEntities stores an informational list of which child entity
|
|
289
|
+
* types have records for this PK. The overlapping parent is the leaf
|
|
290
|
+
* of its own chain — it does not delegate save/delete downward. Each
|
|
291
|
+
* child entity independently chains upward to the parent via
|
|
292
|
+
* _parentEntity, and save/delete flows upward through that chain.
|
|
293
|
+
* Person → _childEntities = [{entityName:'Members'}, {entityName:'Speakers'}]
|
|
294
|
+
* MemberEntity._parentEntity = PersonEntity (independent chain)
|
|
295
|
+
* SpeakerEntity._parentEntity = PersonEntity (independent chain)
|
|
296
|
+
*
|
|
297
|
+
* Record Change propagation for overlapping subtypes is handled at the
|
|
298
|
+
* provider level (SQLServerDataProvider.PropagateRecordChangesToSiblings),
|
|
299
|
+
* not in BaseEntity.
|
|
273
300
|
**************************************************************************/
|
|
274
301
|
/**
|
|
275
302
|
* Persistent reference to the parent entity in the IS-A chain.
|
|
276
303
|
* For example, if MeetingEntity IS-A ProductEntity, the MeetingEntity instance
|
|
277
304
|
* holds a reference to a ProductEntity instance here. This is null for entities
|
|
278
|
-
* that are not IS-A child types.
|
|
305
|
+
* that are not IS-A child types. Used identically for both disjoint and
|
|
306
|
+
* overlapping subtypes — child entities always chain upward to their parent.
|
|
279
307
|
*/
|
|
280
308
|
private _parentEntity;
|
|
281
309
|
/**
|
|
282
|
-
* Persistent reference to the child entity in
|
|
310
|
+
* Persistent reference to the single child entity in a **disjoint** IS-A chain.
|
|
283
311
|
* For example, if MeetingEntity has a Webinar child record with the same PK,
|
|
284
312
|
* the MeetingEntity instance holds a reference to a WebinarEntity instance here.
|
|
285
313
|
* Populated after Load/Hydrate when child discovery finds a matching record.
|
|
286
|
-
*
|
|
314
|
+
*
|
|
315
|
+
* **Only used for disjoint subtypes** (AllowMultipleSubtypes = false).
|
|
316
|
+
* For overlapping parents, this field is not populated — use _childEntities
|
|
317
|
+
* instead, which stores the list of child entity type names. The ISAChild
|
|
318
|
+
* getter returns null for overlapping parents to enforce this distinction.
|
|
319
|
+
*
|
|
320
|
+
* Null when: no child record exists, entity is a leaf, entity hasn't been
|
|
321
|
+
* loaded yet, or entity is an overlapping parent.
|
|
287
322
|
*/
|
|
288
323
|
private _childEntity;
|
|
289
324
|
/**
|
|
@@ -297,6 +332,23 @@ export declare abstract class BaseEntity<T = unknown> {
|
|
|
297
332
|
* loaded record. Reset to false on NewRecord() and init().
|
|
298
333
|
*/
|
|
299
334
|
private _childEntityDiscoveryDone;
|
|
335
|
+
/**
|
|
336
|
+
* For **overlapping** subtype parents (AllowMultipleSubtypes = true), stores
|
|
337
|
+
* the list of child entity type names that have records for this PK.
|
|
338
|
+
* Populated during InitializeChildEntity() via discoverOverlappingChildren().
|
|
339
|
+
*
|
|
340
|
+
* **Only used for overlapping subtypes.** For disjoint parents, this is null —
|
|
341
|
+
* use _childEntity instead, which holds a live BaseEntity reference for
|
|
342
|
+
* composition chaining. The ISAChildren getter exposes this publicly.
|
|
343
|
+
*
|
|
344
|
+
* This is an **informational list** (entity names only, no live object
|
|
345
|
+
* references) used for UI display (IS-A related panel, breadcrumb tree)
|
|
346
|
+
* and Record Change propagation. It does NOT participate in save/delete
|
|
347
|
+
* orchestration — each child entity chains independently via _parentEntity.
|
|
348
|
+
*
|
|
349
|
+
* Null for disjoint parents, non-parent entities, or entities not yet loaded.
|
|
350
|
+
*/
|
|
351
|
+
private _childEntities;
|
|
300
352
|
/**
|
|
301
353
|
* Opaque provider-level transaction handle. Used by IS-A save/delete orchestration
|
|
302
354
|
* to share a single SQL transaction across the parent chain.
|
|
@@ -326,12 +378,24 @@ export declare abstract class BaseEntity<T = unknown> {
|
|
|
326
378
|
get ISAParent(): BaseEntity | null;
|
|
327
379
|
/**
|
|
328
380
|
* Returns the child entity in the IS-A composition chain, or null if this
|
|
329
|
-
* entity has no child record
|
|
381
|
+
* entity has no child record, hasn't been loaded yet, or is an overlapping
|
|
382
|
+
* subtype parent (use `ISAChildren` instead for overlapping parents).
|
|
330
383
|
*
|
|
331
384
|
* Example: For a MeetingEntity where a Webinar record exists with the same PK,
|
|
332
385
|
* `ISAChild` returns the WebinarEntity instance.
|
|
333
386
|
*/
|
|
334
387
|
get ISAChild(): BaseEntity | null;
|
|
388
|
+
/**
|
|
389
|
+
* For overlapping subtype parents (AllowMultipleSubtypes = true), returns
|
|
390
|
+
* the list of child entity type names that have records for this PK.
|
|
391
|
+
* For disjoint parents or non-parent entities, returns null (use `ISAChild` instead).
|
|
392
|
+
*
|
|
393
|
+
* Example: For a PersonEntity with AllowMultipleSubtypes=true, might return
|
|
394
|
+
* [{entityName: 'Members'}, {entityName: 'Volunteers'}, {entityName: 'Speakers'}].
|
|
395
|
+
*/
|
|
396
|
+
get ISAChildren(): {
|
|
397
|
+
entityName: string;
|
|
398
|
+
}[] | null;
|
|
335
399
|
/**
|
|
336
400
|
* @deprecated Use `ISAParent` instead. Kept for backward compatibility.
|
|
337
401
|
*/
|
|
@@ -365,8 +429,17 @@ export declare abstract class BaseEntity<T = unknown> {
|
|
|
365
429
|
* Uses the provider's FindISAChildEntity method (single UNION ALL query) to
|
|
366
430
|
* determine which child entity type, if any, has a record with our PK value.
|
|
367
431
|
* Returns the child entity name or null if no child exists.
|
|
432
|
+
* Used for disjoint (non-overlapping) parent entities.
|
|
368
433
|
*/
|
|
369
434
|
private discoverChildEntityName;
|
|
435
|
+
/**
|
|
436
|
+
* Discovers ALL child entity types that have records with our PK value.
|
|
437
|
+
* Used for overlapping subtype parents (AllowMultipleSubtypes = true) where
|
|
438
|
+
* multiple children can coexist. Stores the result in _childEntities but does
|
|
439
|
+
* NOT auto-chain to any single child — the caller must use GetEntityObject
|
|
440
|
+
* to load a specific child type when needed.
|
|
441
|
+
*/
|
|
442
|
+
private discoverOverlappingChildren;
|
|
370
443
|
/**
|
|
371
444
|
* Creates the child entity instance, wires up the shared instance chain
|
|
372
445
|
* (child._parentEntity = this, this._childEntity = child), loads the
|
|
@@ -386,6 +459,10 @@ export declare abstract class BaseEntity<T = unknown> {
|
|
|
386
459
|
/**
|
|
387
460
|
* Returns the leaf (most-derived) entity in the IS-A chain, walking
|
|
388
461
|
* downward through child references. Returns `this` if no child exists.
|
|
462
|
+
*
|
|
463
|
+
* For overlapping subtype parents (AllowMultipleSubtypes = true), returns
|
|
464
|
+
* `this` because there is no single child chain to follow — the parent
|
|
465
|
+
* is the leaf from its own perspective.
|
|
389
466
|
*/
|
|
390
467
|
get LeafEntity(): BaseEntity;
|
|
391
468
|
/**
|
|
@@ -717,6 +794,13 @@ export declare abstract class BaseEntity<T = unknown> {
|
|
|
717
794
|
* @returns
|
|
718
795
|
*/
|
|
719
796
|
private _InnerSave;
|
|
797
|
+
/**
|
|
798
|
+
* Determines whether the parent entity should be deleted after this child entity
|
|
799
|
+
* has been deleted. For overlapping subtype parents (AllowMultipleSubtypes = true),
|
|
800
|
+
* the parent is preserved if other child records still exist. For disjoint parents
|
|
801
|
+
* (default), always returns true to continue the cascade.
|
|
802
|
+
*/
|
|
803
|
+
private shouldDeleteParentAfterChildDelete;
|
|
720
804
|
/**
|
|
721
805
|
* Helper to rollback an IS-A provider transaction if one is active.
|
|
722
806
|
* Only called by the IS-A initiator (the leaf entity that started the chain).
|
|
@@ -904,6 +988,10 @@ export declare abstract class BaseEntity<T = unknown> {
|
|
|
904
988
|
* child types (excluding self) for records with the same PK value.
|
|
905
989
|
* Throws if a sibling child record is found.
|
|
906
990
|
*
|
|
991
|
+
* Only called when the parent entity has `AllowMultipleSubtypes = false` (default).
|
|
992
|
+
* When `AllowMultipleSubtypes = true`, this check is skipped entirely, allowing
|
|
993
|
+
* overlapping subtypes (e.g., a Person can be both a Member and a Volunteer).
|
|
994
|
+
*
|
|
907
995
|
* Only runs on Database providers — client-side (Network/GraphQL) skips this
|
|
908
996
|
* because the server-side save will perform the check authoritatively.
|
|
909
997
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseEntity.d.ts","sourceRoot":"","sources":["../../src/generic/baseEntity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe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ntity {
|
|
|
488
488
|
get ISAParent() { return this._parentEntity; }
|
|
489
489
|
/**
|
|
490
490
|
* Returns the child entity in the IS-A composition chain, or null if this
|
|
491
|
-
* entity has no child record
|
|
491
|
+
* entity has no child record, hasn't been loaded yet, or is an overlapping
|
|
492
|
+
* subtype parent (use `ISAChildren` instead for overlapping parents).
|
|
492
493
|
*
|
|
493
494
|
* Example: For a MeetingEntity where a Webinar record exists with the same PK,
|
|
494
495
|
* `ISAChild` returns the WebinarEntity instance.
|
|
495
496
|
*/
|
|
496
|
-
get ISAChild() {
|
|
497
|
+
get ISAChild() {
|
|
498
|
+
// For overlapping parents, there is no single child to chain to
|
|
499
|
+
if (this.EntityInfo?.AllowMultipleSubtypes && this._childEntities !== null) {
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
return this._childEntity;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* For overlapping subtype parents (AllowMultipleSubtypes = true), returns
|
|
506
|
+
* the list of child entity type names that have records for this PK.
|
|
507
|
+
* For disjoint parents or non-parent entities, returns null (use `ISAChild` instead).
|
|
508
|
+
*
|
|
509
|
+
* Example: For a PersonEntity with AllowMultipleSubtypes=true, might return
|
|
510
|
+
* [{entityName: 'Members'}, {entityName: 'Volunteers'}, {entityName: 'Speakers'}].
|
|
511
|
+
*/
|
|
512
|
+
get ISAChildren() {
|
|
513
|
+
return this._childEntities;
|
|
514
|
+
}
|
|
497
515
|
/**
|
|
498
516
|
* @deprecated Use `ISAParent` instead. Kept for backward compatibility.
|
|
499
517
|
*/
|
|
@@ -520,20 +538,55 @@ export class BaseEntity {
|
|
|
520
538
|
*
|
|
521
539
|
* All data routing (Set/Get), dirty tracking, validation, and save/delete
|
|
522
540
|
* orchestration flow through this composition chain.
|
|
541
|
+
*
|
|
542
|
+
* ## Disjoint vs Overlapping Subtypes
|
|
543
|
+
*
|
|
544
|
+
* Two modes of child relationship exist, controlled by the parent entity's
|
|
545
|
+
* `AllowMultipleSubtypes` flag:
|
|
546
|
+
*
|
|
547
|
+
* **Disjoint (AllowMultipleSubtypes = false, default):**
|
|
548
|
+
* A parent record has at most ONE child type. _childEntity holds a live
|
|
549
|
+
* BaseEntity reference for composition chaining — save/delete delegates
|
|
550
|
+
* down to the leaf, and LeafEntity traverses through it.
|
|
551
|
+
* Product → _childEntity = MeetingEntity → _childEntity = WebinarEntity
|
|
552
|
+
*
|
|
553
|
+
* **Overlapping (AllowMultipleSubtypes = true):**
|
|
554
|
+
* A parent record can simultaneously exist as MULTIPLE child types.
|
|
555
|
+
* _childEntity is NOT used (ISAChild returns null). Instead,
|
|
556
|
+
* _childEntities stores an informational list of which child entity
|
|
557
|
+
* types have records for this PK. The overlapping parent is the leaf
|
|
558
|
+
* of its own chain — it does not delegate save/delete downward. Each
|
|
559
|
+
* child entity independently chains upward to the parent via
|
|
560
|
+
* _parentEntity, and save/delete flows upward through that chain.
|
|
561
|
+
* Person → _childEntities = [{entityName:'Members'}, {entityName:'Speakers'}]
|
|
562
|
+
* MemberEntity._parentEntity = PersonEntity (independent chain)
|
|
563
|
+
* SpeakerEntity._parentEntity = PersonEntity (independent chain)
|
|
564
|
+
*
|
|
565
|
+
* Record Change propagation for overlapping subtypes is handled at the
|
|
566
|
+
* provider level (SQLServerDataProvider.PropagateRecordChangesToSiblings),
|
|
567
|
+
* not in BaseEntity.
|
|
523
568
|
**************************************************************************/
|
|
524
569
|
/**
|
|
525
570
|
* Persistent reference to the parent entity in the IS-A chain.
|
|
526
571
|
* For example, if MeetingEntity IS-A ProductEntity, the MeetingEntity instance
|
|
527
572
|
* holds a reference to a ProductEntity instance here. This is null for entities
|
|
528
|
-
* that are not IS-A child types.
|
|
573
|
+
* that are not IS-A child types. Used identically for both disjoint and
|
|
574
|
+
* overlapping subtypes — child entities always chain upward to their parent.
|
|
529
575
|
*/
|
|
530
576
|
this._parentEntity = null;
|
|
531
577
|
/**
|
|
532
|
-
* Persistent reference to the child entity in
|
|
578
|
+
* Persistent reference to the single child entity in a **disjoint** IS-A chain.
|
|
533
579
|
* For example, if MeetingEntity has a Webinar child record with the same PK,
|
|
534
580
|
* the MeetingEntity instance holds a reference to a WebinarEntity instance here.
|
|
535
581
|
* Populated after Load/Hydrate when child discovery finds a matching record.
|
|
536
|
-
*
|
|
582
|
+
*
|
|
583
|
+
* **Only used for disjoint subtypes** (AllowMultipleSubtypes = false).
|
|
584
|
+
* For overlapping parents, this field is not populated — use _childEntities
|
|
585
|
+
* instead, which stores the list of child entity type names. The ISAChild
|
|
586
|
+
* getter returns null for overlapping parents to enforce this distinction.
|
|
587
|
+
*
|
|
588
|
+
* Null when: no child record exists, entity is a leaf, entity hasn't been
|
|
589
|
+
* loaded yet, or entity is an overlapping parent.
|
|
537
590
|
*/
|
|
538
591
|
this._childEntity = null;
|
|
539
592
|
/**
|
|
@@ -547,6 +600,23 @@ export class BaseEntity {
|
|
|
547
600
|
* loaded record. Reset to false on NewRecord() and init().
|
|
548
601
|
*/
|
|
549
602
|
this._childEntityDiscoveryDone = false;
|
|
603
|
+
/**
|
|
604
|
+
* For **overlapping** subtype parents (AllowMultipleSubtypes = true), stores
|
|
605
|
+
* the list of child entity type names that have records for this PK.
|
|
606
|
+
* Populated during InitializeChildEntity() via discoverOverlappingChildren().
|
|
607
|
+
*
|
|
608
|
+
* **Only used for overlapping subtypes.** For disjoint parents, this is null —
|
|
609
|
+
* use _childEntity instead, which holds a live BaseEntity reference for
|
|
610
|
+
* composition chaining. The ISAChildren getter exposes this publicly.
|
|
611
|
+
*
|
|
612
|
+
* This is an **informational list** (entity names only, no live object
|
|
613
|
+
* references) used for UI display (IS-A related panel, breadcrumb tree)
|
|
614
|
+
* and Record Change propagation. It does NOT participate in save/delete
|
|
615
|
+
* orchestration — each child entity chains independently via _parentEntity.
|
|
616
|
+
*
|
|
617
|
+
* Null for disjoint parents, non-parent entities, or entities not yet loaded.
|
|
618
|
+
*/
|
|
619
|
+
this._childEntities = null;
|
|
550
620
|
/**
|
|
551
621
|
* Opaque provider-level transaction handle. Used by IS-A save/delete orchestration
|
|
552
622
|
* to share a single SQL transaction across the parent chain.
|
|
@@ -610,15 +680,23 @@ export class BaseEntity {
|
|
|
610
680
|
this._childEntityDiscoveryDone = true;
|
|
611
681
|
if (!this.EntityInfo?.IsParentType)
|
|
612
682
|
return;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
683
|
+
if (this.EntityInfo.AllowMultipleSubtypes) {
|
|
684
|
+
// Overlapping: discover all children, store as list, don't auto-chain
|
|
685
|
+
await this.discoverOverlappingChildren();
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
// Disjoint: discover single child, auto-chain (current behavior)
|
|
689
|
+
const childEntityName = await this.discoverChildEntityName();
|
|
690
|
+
if (!childEntityName)
|
|
691
|
+
return;
|
|
692
|
+
await this.createAndLinkChildEntity(childEntityName);
|
|
693
|
+
}
|
|
617
694
|
}
|
|
618
695
|
/**
|
|
619
696
|
* Uses the provider's FindISAChildEntity method (single UNION ALL query) to
|
|
620
697
|
* determine which child entity type, if any, has a record with our PK value.
|
|
621
698
|
* Returns the child entity name or null if no child exists.
|
|
699
|
+
* Used for disjoint (non-overlapping) parent entities.
|
|
622
700
|
*/
|
|
623
701
|
async discoverChildEntityName() {
|
|
624
702
|
const provider = this.ProviderToUse;
|
|
@@ -627,6 +705,20 @@ export class BaseEntity {
|
|
|
627
705
|
const result = await provider.FindISAChildEntity(this.EntityInfo, this.PrimaryKey.Values(), this._contextCurrentUser);
|
|
628
706
|
return result?.ChildEntityName ?? null;
|
|
629
707
|
}
|
|
708
|
+
/**
|
|
709
|
+
* Discovers ALL child entity types that have records with our PK value.
|
|
710
|
+
* Used for overlapping subtype parents (AllowMultipleSubtypes = true) where
|
|
711
|
+
* multiple children can coexist. Stores the result in _childEntities but does
|
|
712
|
+
* NOT auto-chain to any single child — the caller must use GetEntityObject
|
|
713
|
+
* to load a specific child type when needed.
|
|
714
|
+
*/
|
|
715
|
+
async discoverOverlappingChildren() {
|
|
716
|
+
const provider = this.ProviderToUse;
|
|
717
|
+
if (!provider?.FindISAChildEntities)
|
|
718
|
+
return;
|
|
719
|
+
const results = await provider.FindISAChildEntities(this.EntityInfo, this.PrimaryKey.Values(), this._contextCurrentUser);
|
|
720
|
+
this._childEntities = results.map(r => ({ entityName: r.ChildEntityName }));
|
|
721
|
+
}
|
|
630
722
|
/**
|
|
631
723
|
* Creates the child entity instance, wires up the shared instance chain
|
|
632
724
|
* (child._parentEntity = this, this._childEntity = child), loads the
|
|
@@ -690,10 +782,18 @@ export class BaseEntity {
|
|
|
690
782
|
/**
|
|
691
783
|
* Returns the leaf (most-derived) entity in the IS-A chain, walking
|
|
692
784
|
* downward through child references. Returns `this` if no child exists.
|
|
785
|
+
*
|
|
786
|
+
* For overlapping subtype parents (AllowMultipleSubtypes = true), returns
|
|
787
|
+
* `this` because there is no single child chain to follow — the parent
|
|
788
|
+
* is the leaf from its own perspective.
|
|
693
789
|
*/
|
|
694
790
|
get LeafEntity() {
|
|
695
791
|
let current = this;
|
|
696
792
|
while (current._childEntity) {
|
|
793
|
+
// Stop at overlapping parents — they don't chain to a single child
|
|
794
|
+
if (current.EntityInfo?.AllowMultipleSubtypes && current._childEntities !== null) {
|
|
795
|
+
break;
|
|
796
|
+
}
|
|
697
797
|
current = current._childEntity;
|
|
698
798
|
}
|
|
699
799
|
return current;
|
|
@@ -1440,8 +1540,9 @@ export class BaseEntity {
|
|
|
1440
1540
|
NewRecord(newValues) {
|
|
1441
1541
|
this.init();
|
|
1442
1542
|
this._everSaved = false; // Reset save state for new record
|
|
1443
|
-
// Clear child entity — new records don't have children yet
|
|
1543
|
+
// Clear child entity state — new records don't have children yet
|
|
1444
1544
|
this._childEntity = null;
|
|
1545
|
+
this._childEntities = null;
|
|
1445
1546
|
this._childEntityDiscoveryDone = false;
|
|
1446
1547
|
// Generate UUID for non-auto-increment uniqueidentifier primary keys
|
|
1447
1548
|
if (this.EntityInfo.PrimaryKeys.length === 1) {
|
|
@@ -1554,7 +1655,8 @@ export class BaseEntity {
|
|
|
1554
1655
|
parentSaveOptions.SkipOldValuesCheck = _options.SkipOldValuesCheck;
|
|
1555
1656
|
parentSaveOptions.SkipAsyncValidation = _options.SkipAsyncValidation;
|
|
1556
1657
|
parentSaveOptions.IsParentEntitySave = true;
|
|
1557
|
-
|
|
1658
|
+
parentSaveOptions.ISAActiveChildEntityName = this.EntityInfo.Name;
|
|
1659
|
+
const parentResult = await this._parentEntity.Save(parentSaveOptions); // we know parent entity exists hre
|
|
1558
1660
|
if (!parentResult) {
|
|
1559
1661
|
// Parent save failed — rollback if we started the transaction
|
|
1560
1662
|
await this.RollbackISATransaction(isISAInitiator);
|
|
@@ -1566,9 +1668,14 @@ export class BaseEntity {
|
|
|
1566
1668
|
this.CheckPermissions(type, true); // this will throw an error and exit out if we don't have permission
|
|
1567
1669
|
// IS-A disjoint subtype enforcement: on CREATE, ensure parent record
|
|
1568
1670
|
// isn't already claimed by another child type (e.g., can't create Meeting
|
|
1569
|
-
// if a Publication already exists with the same Product ID)
|
|
1671
|
+
// if a Publication already exists with the same Product ID).
|
|
1672
|
+
// Skipped when the parent entity has AllowMultipleSubtypes = true,
|
|
1673
|
+
// which permits overlapping child types (e.g., Person -> Member + Volunteer).
|
|
1570
1674
|
if (!this.IsSaved && this.EntityInfo.IsChildType && !_options.ReplayOnly) {
|
|
1571
|
-
|
|
1675
|
+
const parentEntityInfo = this.EntityInfo.ParentEntityInfo;
|
|
1676
|
+
if (parentEntityInfo && !parentEntityInfo.AllowMultipleSubtypes) {
|
|
1677
|
+
await this.EnforceDisjointSubtype();
|
|
1678
|
+
}
|
|
1572
1679
|
}
|
|
1573
1680
|
if (_options.IgnoreDirtyState || initialDirtyState || _options.ReplayOnly) {
|
|
1574
1681
|
// Raise save_started event only when we're actually going to save
|
|
@@ -1660,6 +1767,30 @@ export class BaseEntity {
|
|
|
1660
1767
|
return false;
|
|
1661
1768
|
}
|
|
1662
1769
|
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Determines whether the parent entity should be deleted after this child entity
|
|
1772
|
+
* has been deleted. For overlapping subtype parents (AllowMultipleSubtypes = true),
|
|
1773
|
+
* the parent is preserved if other child records still exist. For disjoint parents
|
|
1774
|
+
* (default), always returns true to continue the cascade.
|
|
1775
|
+
*/
|
|
1776
|
+
async shouldDeleteParentAfterChildDelete() {
|
|
1777
|
+
if (!this._parentEntity)
|
|
1778
|
+
return false;
|
|
1779
|
+
const parentInfo = this._parentEntity.EntityInfo;
|
|
1780
|
+
if (!parentInfo.AllowMultipleSubtypes) {
|
|
1781
|
+
// Disjoint: always cascade delete to parent (existing behavior)
|
|
1782
|
+
return true;
|
|
1783
|
+
}
|
|
1784
|
+
// Overlapping: check if other children still reference this parent
|
|
1785
|
+
const provider = this.ProviderToUse;
|
|
1786
|
+
if (!provider?.FindISAChildEntities) {
|
|
1787
|
+
// Provider doesn't support child discovery — err on the side of caution
|
|
1788
|
+
return true;
|
|
1789
|
+
}
|
|
1790
|
+
const remainingChildren = await provider.FindISAChildEntities(parentInfo, this.PrimaryKey.Values(), this._contextCurrentUser);
|
|
1791
|
+
// If no remaining children, safe to delete parent
|
|
1792
|
+
return remainingChildren.length === 0;
|
|
1793
|
+
}
|
|
1663
1794
|
/**
|
|
1664
1795
|
* Helper to rollback an IS-A provider transaction if one is active.
|
|
1665
1796
|
* Only called by the IS-A initiator (the leaf entity that started the chain).
|
|
@@ -2128,16 +2259,21 @@ export class BaseEntity {
|
|
|
2128
2259
|
if (await this.ProviderToUse.Delete(this, _options, this.ActiveUser)) {
|
|
2129
2260
|
// IS-A: after own delete succeeds, cascade to parent chain
|
|
2130
2261
|
if (hasParentChain) {
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2262
|
+
// For overlapping subtypes, check if other children still reference
|
|
2263
|
+
// the parent before deleting it. If siblings exist, preserve the parent.
|
|
2264
|
+
const shouldDeleteParent = await this.shouldDeleteParentAfterChildDelete();
|
|
2265
|
+
if (shouldDeleteParent) {
|
|
2266
|
+
const parentDeleteOptions = new EntityDeleteOptions();
|
|
2267
|
+
parentDeleteOptions.SkipEntityAIActions = _options.SkipEntityAIActions;
|
|
2268
|
+
parentDeleteOptions.SkipEntityActions = _options.SkipEntityActions;
|
|
2269
|
+
parentDeleteOptions.ReplayOnly = _options.ReplayOnly;
|
|
2270
|
+
parentDeleteOptions.IsParentEntityDelete = true;
|
|
2271
|
+
const parentResult = await this._parentEntity.Delete(parentDeleteOptions);
|
|
2272
|
+
if (!parentResult) {
|
|
2273
|
+
// Parent delete failed — rollback if we started the transaction
|
|
2274
|
+
await this.RollbackISATransaction(isISAInitiator);
|
|
2275
|
+
return false;
|
|
2276
|
+
}
|
|
2141
2277
|
}
|
|
2142
2278
|
}
|
|
2143
2279
|
// IS-A: commit transaction after successful chain delete
|
|
@@ -2306,6 +2442,10 @@ export class BaseEntity {
|
|
|
2306
2442
|
* child types (excluding self) for records with the same PK value.
|
|
2307
2443
|
* Throws if a sibling child record is found.
|
|
2308
2444
|
*
|
|
2445
|
+
* Only called when the parent entity has `AllowMultipleSubtypes = false` (default).
|
|
2446
|
+
* When `AllowMultipleSubtypes = true`, this check is skipped entirely, allowing
|
|
2447
|
+
* overlapping subtypes (e.g., a Person can be both a Member and a Volunteer).
|
|
2448
|
+
*
|
|
2309
2449
|
* Only runs on Database providers — client-side (Network/GraphQL) skips this
|
|
2310
2450
|
* because the server-side save will perform the check authoritatively.
|
|
2311
2451
|
*/
|