@finos/legend-graph 32.0.5 → 32.0.7
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/lib/graph/Core_HashUtils.d.ts +2 -0
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +2 -0
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/helpers/DomainHelper.d.ts +3 -1
- package/lib/graph/helpers/DomainHelper.d.ts.map +1 -1
- package/lib/graph/helpers/DomainHelper.js +8 -2
- package/lib/graph/helpers/DomainHelper.js.map +1 -1
- package/lib/graph/helpers/PureLanguageHelper.d.ts +2 -0
- package/lib/graph/helpers/PureLanguageHelper.d.ts.map +1 -1
- package/lib/graph/helpers/PureLanguageHelper.js +7 -1
- package/lib/graph/helpers/PureLanguageHelper.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.d.ts +3 -4
- package/lib/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js +1 -1
- package/lib/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.d.ts +2 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/SetImplementation.d.ts +2 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/SetImplementation.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/SetImplementation.js +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/SetImplementation.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.d.ts +40 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.js +47 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.d.ts +28 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.js +51 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.js.map +1 -0
- package/lib/graph/metamodel/pure/valueSpecification/RelationValueSpecification.d.ts +5 -0
- package/lib/graph/metamodel/pure/valueSpecification/RelationValueSpecification.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/valueSpecification/RelationValueSpecification.js +14 -0
- package/lib/graph/metamodel/pure/valueSpecification/RelationValueSpecification.js.map +1 -1
- package/lib/graph/metamodel/pure/valueSpecification/ValueSpecification.d.ts +2 -1
- package/lib/graph/metamodel/pure/valueSpecification/ValueSpecification.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/valueSpecification/ValueSpecification.js.map +1 -1
- package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.d.ts.map +1 -1
- package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.js +6 -0
- package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.js.map +1 -1
- package/lib/graph-manager/action/changeDetection/DomainObserverHelper.js +1 -1
- package/lib/graph-manager/action/changeDetection/DomainObserverHelper.js.map +1 -1
- package/lib/graph-manager/action/changeDetection/ValueSpecificationObserver.d.ts +2 -1
- package/lib/graph-manager/action/changeDetection/ValueSpecificationObserver.d.ts.map +1 -1
- package/lib/graph-manager/action/changeDetection/ValueSpecificationObserver.js +12 -0
- package/lib/graph-manager/action/changeDetection/ValueSpecificationObserver.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_ClassMapping.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_ClassMapping.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_ClassMapping.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_PropertyMapping.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_PropertyMapping.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_PropertyMapping.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionClassMapping.d.ts +26 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionClassMapping.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionClassMapping.js +48 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionClassMapping.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionPropertyMapping.d.ts +38 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionPropertyMapping.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionPropertyMapping.js +47 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionPropertyMapping.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.d.ts +3 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.js +7 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +39 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js +13 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingFirstPassBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingFirstPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingFirstPassBuilder.js +6 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingFirstPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.js +16 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js +3 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +2 -2
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts +3 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js +9 -2
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js +38 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +11 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +38 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/graph/Core_HashUtils.ts +2 -0
- package/src/graph/helpers/DomainHelper.ts +13 -3
- package/src/graph/helpers/PureLanguageHelper.ts +13 -3
- package/src/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.ts +4 -5
- package/src/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.ts +4 -0
- package/src/graph/metamodel/pure/packageableElements/mapping/SetImplementation.ts +5 -1
- package/src/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.ts +58 -0
- package/src/graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.ts +72 -0
- package/src/graph/metamodel/pure/valueSpecification/RelationValueSpecification.ts +16 -0
- package/src/graph/metamodel/pure/valueSpecification/ValueSpecification.ts +5 -1
- package/src/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.ts +14 -0
- package/src/graph-manager/action/changeDetection/DomainObserverHelper.ts +1 -1
- package/src/graph-manager/action/changeDetection/ValueSpecificationObserver.ts +21 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_ClassMapping.ts +4 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_PropertyMapping.ts +4 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionClassMapping.ts +60 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_RelationFunctionPropertyMapping.ts +57 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts +16 -3
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +71 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.ts +27 -1
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingFirstPassBuilder.ts +18 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.ts +46 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.ts +6 -1
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +3 -6
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.ts +20 -1
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.ts +91 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +17 -3
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +59 -0
- package/src/index.ts +2 -0
- package/tsconfig.json +4 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../Core_HashUtils.js';
|
|
34
|
+
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
35
|
+
import {
|
|
36
|
+
type PropertyMappingVisitor,
|
|
37
|
+
PropertyMapping,
|
|
38
|
+
} from '../PropertyMapping.js';
|
|
39
|
+
import type { PropertyReference } from '../../domain/PropertyReference.js';
|
|
40
|
+
import type { PropertyMappingsImplementation } from '../PropertyMappingsImplementation.js';
|
|
41
|
+
import type { SetImplementationReference } from '../SetImplementationReference.js';
|
|
42
|
+
import type { RelationColumn } from '../../relation/RelationType.js';
|
|
43
|
+
|
|
44
|
+
export class RelationFunctionPropertyMapping
|
|
45
|
+
extends PropertyMapping
|
|
46
|
+
implements Hashable
|
|
47
|
+
{
|
|
48
|
+
column: RelationColumn;
|
|
49
|
+
|
|
50
|
+
constructor(
|
|
51
|
+
owner: PropertyMappingsImplementation,
|
|
52
|
+
property: PropertyReference,
|
|
53
|
+
source: SetImplementationReference,
|
|
54
|
+
target: SetImplementationReference | undefined,
|
|
55
|
+
column: RelationColumn,
|
|
56
|
+
) {
|
|
57
|
+
super(owner, property, source, target);
|
|
58
|
+
this.column = column;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
override get hashCode(): string {
|
|
62
|
+
return hashArray([
|
|
63
|
+
CORE_HASH_STRUCTURE.RELATION_FUNCTION_PROPERTY_MAPPING,
|
|
64
|
+
super.hashCode,
|
|
65
|
+
this.column.name,
|
|
66
|
+
]);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
accept_PropertyMappingVisitor<T>(visitor: PropertyMappingVisitor<T>): T {
|
|
70
|
+
return visitor.visit_RelationFunctionPropertyMapping(this);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -41,7 +41,23 @@ export class ColSpec implements Hashable {
|
|
|
41
41
|
]);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
export class ColSpecInstanceValue extends InstanceValue implements Hashable {
|
|
45
|
+
override values: ColSpec[] = [];
|
|
44
46
|
|
|
47
|
+
override get hashCode(): string {
|
|
48
|
+
return hashArray([
|
|
49
|
+
CORE_HASH_STRUCTURE.RELATION_COL_SPEC,
|
|
50
|
+
this.genericType?.ownerReference.valueForSerialization ?? '',
|
|
51
|
+
this.multiplicity,
|
|
52
|
+
hashArray(this.values),
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
override accept_ValueSpecificationVisitor<T>(
|
|
56
|
+
visitor: ValueSpecificationVisitor<T>,
|
|
57
|
+
): T {
|
|
58
|
+
return visitor.visit_ColSpecInstance(this);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
45
61
|
export class ColSpecArray implements Hashable {
|
|
46
62
|
colSpecs: ColSpec[] = [];
|
|
47
63
|
|
|
@@ -34,7 +34,10 @@ import type { VariableExpression } from './VariableExpression.js';
|
|
|
34
34
|
import type { INTERNAL__PropagatedValue } from './INTERNAL__PropagatedValue.js';
|
|
35
35
|
import type { Hashable } from '@finos/legend-shared';
|
|
36
36
|
import type { KeyExpressionInstanceValue } from './KeyExpressionInstanceValue.js';
|
|
37
|
-
import type {
|
|
37
|
+
import type {
|
|
38
|
+
ColSpecArrayInstance,
|
|
39
|
+
ColSpecInstanceValue,
|
|
40
|
+
} from './RelationValueSpecification.js';
|
|
38
41
|
|
|
39
42
|
export interface ValueSpecificationVisitor<T> {
|
|
40
43
|
visit_INTERNAL__UnknownValueSpecification(
|
|
@@ -55,6 +58,7 @@ export interface ValueSpecificationVisitor<T> {
|
|
|
55
58
|
|
|
56
59
|
visit_InstanceValue(valueSpecification: InstanceValue): T;
|
|
57
60
|
visit_ColSpecArrayInstance(valueSpeciciation: ColSpecArrayInstance): T;
|
|
61
|
+
visit_ColSpecInstance(valueSpeciciation: ColSpecInstanceValue): T;
|
|
58
62
|
|
|
59
63
|
visit_CollectionInstanceValue(valueSpecification: CollectionInstanceValue): T;
|
|
60
64
|
visit_EnumValueInstanceValue(valueSpecification: EnumValueInstanceValue): T;
|
|
@@ -132,6 +132,8 @@ import type { INTERNAL__UnknownConnection } from '../../../graph/metamodel/pure/
|
|
|
132
132
|
import type { INTERNAL__UnknownPropertyMapping } from '../../../graph/metamodel/pure/packageableElements/mapping/INTERNAL__UnknownPropertyMapping.js';
|
|
133
133
|
import type { INTERNAL__UnknownSetImplementation } from '../../../graph/metamodel/pure/packageableElements/mapping/INTERNAL__UnknownSetImplementation.js';
|
|
134
134
|
import type { INTERNAL__UnknownStore } from '../../../graph/metamodel/pure/packageableElements/store/INTERNAL__UnknownStore.js';
|
|
135
|
+
import type { RelationFunctionInstanceSetImplementation } from '../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.js';
|
|
136
|
+
import type { RelationFunctionPropertyMapping } from '../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.js';
|
|
135
137
|
|
|
136
138
|
// ------------------------------------- Store -------------------------------------
|
|
137
139
|
|
|
@@ -396,6 +398,12 @@ class PropertyMappingObserver implements PropertyMappingVisitor<void> {
|
|
|
396
398
|
visit_XStorePropertyMapping(propertyMapping: XStorePropertyMapping): void {
|
|
397
399
|
// TODO
|
|
398
400
|
}
|
|
401
|
+
|
|
402
|
+
visit_RelationFunctionPropertyMapping(
|
|
403
|
+
propertyMapping: RelationFunctionPropertyMapping,
|
|
404
|
+
): void {
|
|
405
|
+
// TODO
|
|
406
|
+
}
|
|
399
407
|
}
|
|
400
408
|
|
|
401
409
|
export const observe_PropertyMapping = (
|
|
@@ -636,6 +644,12 @@ class SetImplementationObserver implements SetImplementationVisitor<void> {
|
|
|
636
644
|
);
|
|
637
645
|
}
|
|
638
646
|
|
|
647
|
+
visit_RelationFunctionInstanceSetImplementation(
|
|
648
|
+
setImplementation: RelationFunctionInstanceSetImplementation,
|
|
649
|
+
): void {
|
|
650
|
+
// TODO
|
|
651
|
+
}
|
|
652
|
+
|
|
639
653
|
visit_AggregationAwareSetImplementation(
|
|
640
654
|
setImplementation: AggregationAwareSetImplementation,
|
|
641
655
|
): void {
|
|
@@ -540,7 +540,7 @@ export const observe_ConcreteFunctionDefinition = skipObservedWithContext(
|
|
|
540
540
|
});
|
|
541
541
|
|
|
542
542
|
metamodel.parameters.forEach(observe_RawVariableExpression);
|
|
543
|
-
|
|
543
|
+
observe_GenericTypeReference(metamodel.returnType);
|
|
544
544
|
metamodel.stereotypes.forEach(observe_StereotypeReference);
|
|
545
545
|
metamodel.taggedValues.forEach(observe_TaggedValue);
|
|
546
546
|
metamodel.tests.forEach((t) => observe_FunctionTestSuite(t, context));
|
|
@@ -64,6 +64,7 @@ import type {
|
|
|
64
64
|
ColSpec,
|
|
65
65
|
ColSpecArray,
|
|
66
66
|
ColSpecArrayInstance,
|
|
67
|
+
ColSpecInstanceValue,
|
|
67
68
|
} from '../../../graph/metamodel/pure/valueSpecification/RelationValueSpecification.js';
|
|
68
69
|
|
|
69
70
|
const observe_Abstract_ValueSpecification = (
|
|
@@ -194,6 +195,10 @@ export const observe_ColSpecArrayInstance = skipObservedWithContext(
|
|
|
194
195
|
_observe_ColSpecArrayInstance,
|
|
195
196
|
);
|
|
196
197
|
|
|
198
|
+
export const observe_ColSpecInstance = skipObservedWithContext(
|
|
199
|
+
_observe_ColSpecInstance,
|
|
200
|
+
);
|
|
201
|
+
|
|
197
202
|
const observe_LambdaFunction = skipObservedWithContext(_observe_LambdaFunction);
|
|
198
203
|
|
|
199
204
|
const observe_LambdaFunctionInstanceValue = skipObservedWithContext(
|
|
@@ -344,6 +349,10 @@ class ValueSpecificationObserver implements ValueSpecificationVisitor<void> {
|
|
|
344
349
|
visit_ColSpecArrayInstance(valueSpeciciation: ColSpecArrayInstance): void {
|
|
345
350
|
observe_ColSpecArrayInstance(valueSpeciciation, this.observerContext);
|
|
346
351
|
}
|
|
352
|
+
|
|
353
|
+
visit_ColSpecInstance(valueSpeciciation: ColSpecInstanceValue): void {
|
|
354
|
+
observe_ColSpecInstance(valueSpeciciation, this.observerContext);
|
|
355
|
+
}
|
|
347
356
|
}
|
|
348
357
|
|
|
349
358
|
export const observe_ValueSpecification = skipObservedWithContext(
|
|
@@ -513,6 +522,18 @@ function _observe_ColSpecArrayInstance(
|
|
|
513
522
|
return metamodel;
|
|
514
523
|
}
|
|
515
524
|
|
|
525
|
+
function _observe_ColSpecInstance(
|
|
526
|
+
metamodel: ColSpecInstanceValue,
|
|
527
|
+
context: ObserverContext,
|
|
528
|
+
): ColSpecInstanceValue {
|
|
529
|
+
observe_Abstract_InstanceValue(metamodel, context);
|
|
530
|
+
makeObservable(metamodel, {
|
|
531
|
+
hashCode: override,
|
|
532
|
+
});
|
|
533
|
+
metamodel.values.forEach((value) => observe_ColSpec(value, context));
|
|
534
|
+
return metamodel;
|
|
535
|
+
}
|
|
536
|
+
|
|
516
537
|
function _observe_ColSpec(
|
|
517
538
|
metamodel: ColSpec,
|
|
518
539
|
context: ObserverContext,
|
package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_ClassMapping.ts
CHANGED
|
@@ -25,6 +25,7 @@ import type { V1_PureInstanceClassMapping } from '../../../model/packageableElem
|
|
|
25
25
|
import type { V1_RootFlatDataClassMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_RootFlatDataClassMapping.js';
|
|
26
26
|
import type { V1_MergeOperationClassMapping } from './V1_MergeOperationClassMapping.js';
|
|
27
27
|
import type { V1_INTERNAL__UnknownClassMapping } from './V1_INTERNAL__UnknownClassMapping.js';
|
|
28
|
+
import type { V1_RelationFunctionClassMapping } from './V1_RelationFunctionClassMapping.js';
|
|
28
29
|
|
|
29
30
|
export interface V1_ClassMappingVisitor<T> {
|
|
30
31
|
visit_ClassMapping(classMapping: V1_ClassMapping): T;
|
|
@@ -45,6 +46,9 @@ export interface V1_ClassMappingVisitor<T> {
|
|
|
45
46
|
visit_AggregationAwareClassMapping(
|
|
46
47
|
classMapping: V1_AggregationAwareClassMapping,
|
|
47
48
|
): T;
|
|
49
|
+
visit_RelationFunctionClassMapping(
|
|
50
|
+
classMapping: V1_RelationFunctionClassMapping,
|
|
51
|
+
): T;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
export abstract class V1_ClassMapping implements Hashable {
|
package/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_PropertyMapping.ts
CHANGED
|
@@ -29,6 +29,7 @@ import type { V1_EmbeddedFlatDataPropertyMapping } from '../../../model/packagea
|
|
|
29
29
|
import type { V1_XStorePropertyMapping } from './xStore/V1_XStorePropertyMapping.js';
|
|
30
30
|
import type { V1_FlatDataAssociationPropertyMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_FlatDataAssociationPropertyMapping.js';
|
|
31
31
|
import type { V1_INTERNAL__UnknownPropertyMapping } from './V1_INTERNAL__UnknownPropertyMapping.js';
|
|
32
|
+
import type { V1_RelationFunctionPropertyMapping } from './V1_RelationFunctionPropertyMapping.js';
|
|
32
33
|
|
|
33
34
|
export interface V1_PropertyMappingVisitor<T> {
|
|
34
35
|
visit_PropertyMapping(propertyMapping: V1_PropertyMapping): T;
|
|
@@ -60,6 +61,9 @@ export interface V1_PropertyMappingVisitor<T> {
|
|
|
60
61
|
visit_FlatDataAssociationPropertyMapping(
|
|
61
62
|
propertyMapping: V1_FlatDataAssociationPropertyMapping,
|
|
62
63
|
): T;
|
|
64
|
+
visit_RelationFunctionPropertyMapping(
|
|
65
|
+
propertyMapping: V1_RelationFunctionPropertyMapping,
|
|
66
|
+
): T;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
export abstract class V1_PropertyMapping implements Hashable {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
34
|
+
import type { V1_PropertyMapping } from './V1_PropertyMapping.js';
|
|
35
|
+
import {
|
|
36
|
+
type V1_ClassMappingVisitor,
|
|
37
|
+
V1_ClassMapping,
|
|
38
|
+
} from './V1_ClassMapping.js';
|
|
39
|
+
import type { V1_PackageableElementPointer } from '../V1_PackageableElement.js';
|
|
40
|
+
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
41
|
+
|
|
42
|
+
export class V1_RelationFunctionClassMapping
|
|
43
|
+
extends V1_ClassMapping
|
|
44
|
+
implements Hashable
|
|
45
|
+
{
|
|
46
|
+
relationFunction!: V1_PackageableElementPointer;
|
|
47
|
+
propertyMappings: V1_PropertyMapping[] = [];
|
|
48
|
+
|
|
49
|
+
accept_ClassMappingVisitor<T>(visitor: V1_ClassMappingVisitor<T>): T {
|
|
50
|
+
return visitor.visit_RelationFunctionClassMapping(this);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override get hashCode(): string {
|
|
54
|
+
return hashArray([
|
|
55
|
+
CORE_HASH_STRUCTURE.RELATION_FUNCTION_INSTANCE_SET_IMPLEMENTATION,
|
|
56
|
+
super.hashCode,
|
|
57
|
+
hashArray(this.propertyMappings),
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
34
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
35
|
+
import {
|
|
36
|
+
type V1_PropertyMappingVisitor,
|
|
37
|
+
V1_PropertyMapping,
|
|
38
|
+
} from './V1_PropertyMapping.js';
|
|
39
|
+
|
|
40
|
+
export class V1_RelationFunctionPropertyMapping
|
|
41
|
+
extends V1_PropertyMapping
|
|
42
|
+
implements Hashable
|
|
43
|
+
{
|
|
44
|
+
column!: string;
|
|
45
|
+
|
|
46
|
+
accept_PropertyMappingVisitor<T>(visitor: V1_PropertyMappingVisitor<T>): T {
|
|
47
|
+
return visitor.visit_RelationFunctionPropertyMapping(this);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
override get hashCode(): string {
|
|
51
|
+
return hashArray([
|
|
52
|
+
CORE_HASH_STRUCTURE.RELATION_FUNCTION_PROPERTY_MAPPING,
|
|
53
|
+
super.hashCode,
|
|
54
|
+
this.column,
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts
CHANGED
|
@@ -78,6 +78,21 @@ import { V1_DefaultValue } from '../../../model/packageableElements/domain/V1_De
|
|
|
78
78
|
import { PackageableElementPointerType } from '../../../../../../../graph/MetaModelConst.js';
|
|
79
79
|
import { V1_createGenericTypeWithElementPath } from '../../../helpers/V1_DomainHelper.js';
|
|
80
80
|
import { V1_PackageableElementPointer } from '../../../model/packageableElements/V1_PackageableElement.js';
|
|
81
|
+
import type { GenericType } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/GenericType.js';
|
|
82
|
+
import type { V1_GenericType } from '../../../model/packageableElements/type/V1_GenericType.js';
|
|
83
|
+
|
|
84
|
+
export const V1_createGenericType = (
|
|
85
|
+
genericType: GenericType,
|
|
86
|
+
): V1_GenericType => {
|
|
87
|
+
const protocolGenType = V1_createGenericTypeWithElementPath(
|
|
88
|
+
genericType.rawType.path,
|
|
89
|
+
);
|
|
90
|
+
const typeArguments = genericType.typeArguments ?? [];
|
|
91
|
+
protocolGenType.typeArguments = typeArguments.map((t) =>
|
|
92
|
+
V1_createGenericType(t.value),
|
|
93
|
+
);
|
|
94
|
+
return protocolGenType;
|
|
95
|
+
};
|
|
81
96
|
|
|
82
97
|
export const V1_createRawGenericTypeWithElementPath = (
|
|
83
98
|
path: string,
|
|
@@ -331,9 +346,7 @@ export const V1_transformFunction = (
|
|
|
331
346
|
new V1_RawValueSpecificationTransformer(context),
|
|
332
347
|
) as V1_RawVariable,
|
|
333
348
|
);
|
|
334
|
-
_function.returnGenericType =
|
|
335
|
-
element.returnType.valueForSerialization ?? '',
|
|
336
|
-
);
|
|
349
|
+
_function.returnGenericType = V1_createGenericType(element.returnType.value);
|
|
337
350
|
_function.stereotypes = element.stereotypes.map(V1_transformStereotype);
|
|
338
351
|
_function.taggedValues = element.taggedValues.map(V1_transformTaggedValue);
|
|
339
352
|
_function.returnMultiplicity = V1_transformMultiplicity(
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
18
|
guaranteeNonEmptyString,
|
|
19
|
+
guaranteeNonNullable,
|
|
19
20
|
IllegalStateError,
|
|
20
21
|
isNonNullable,
|
|
21
22
|
UnsupportedOperationError,
|
|
@@ -175,6 +176,11 @@ import { V1_INTERNAL__UnknownPropertyMapping } from '../../../model/packageableE
|
|
|
175
176
|
import type { INTERNAL__UnknownSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/INTERNAL__UnknownSetImplementation.js';
|
|
176
177
|
import { V1_INTERNAL__UnknownClassMapping } from '../../../model/packageableElements/mapping/V1_INTERNAL__UnknownClassMapping.js';
|
|
177
178
|
import { V1_PackageableElementPointer } from '../../../model/packageableElements/V1_PackageableElement.js';
|
|
179
|
+
import type { RelationFunctionInstanceSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.js';
|
|
180
|
+
import type { RelationFunctionPropertyMapping } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.js';
|
|
181
|
+
import { V1_RelationFunctionPropertyMapping } from '../../../model/packageableElements/mapping/V1_RelationFunctionPropertyMapping.js';
|
|
182
|
+
import { V1_RelationFunctionClassMapping } from '../../../model/packageableElements/mapping/V1_RelationFunctionClassMapping.js';
|
|
183
|
+
import { generateFunctionPrettyName } from '../../../../../../../graph/helpers/PureLanguageHelper.js';
|
|
178
184
|
|
|
179
185
|
export const V1_transformPropertyReference = (
|
|
180
186
|
element: PropertyReference,
|
|
@@ -766,6 +772,25 @@ const transformAggregationAwarePropertyMapping = (
|
|
|
766
772
|
return propertyMapping;
|
|
767
773
|
};
|
|
768
774
|
|
|
775
|
+
const transformRelationFunctionPropertyMapping = (
|
|
776
|
+
element: RelationFunctionPropertyMapping,
|
|
777
|
+
): V1_RelationFunctionPropertyMapping => {
|
|
778
|
+
const propertyMapping = new V1_RelationFunctionPropertyMapping();
|
|
779
|
+
propertyMapping.column = element.column.name;
|
|
780
|
+
propertyMapping.property = V1_transformPropertyReference(element.property);
|
|
781
|
+
propertyMapping.source =
|
|
782
|
+
element.sourceSetImplementation.valueForSerialization;
|
|
783
|
+
propertyMapping.target =
|
|
784
|
+
element.targetSetImplementation?.valueForSerialization;
|
|
785
|
+
if (element.localMappingProperty) {
|
|
786
|
+
propertyMapping.localMappingProperty = transformLocalPropertyInfo(
|
|
787
|
+
element.localMappingProperty,
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
propertyMapping.column = element.column.name;
|
|
791
|
+
return propertyMapping;
|
|
792
|
+
};
|
|
793
|
+
|
|
769
794
|
class PropertyMappingTransformer
|
|
770
795
|
implements PropertyMappingVisitor<V1_PropertyMapping>
|
|
771
796
|
{
|
|
@@ -885,6 +910,12 @@ class PropertyMappingTransformer
|
|
|
885
910
|
): V1_PropertyMapping {
|
|
886
911
|
return transformAggregationAwarePropertyMapping(propertyMapping);
|
|
887
912
|
}
|
|
913
|
+
|
|
914
|
+
visit_RelationFunctionPropertyMapping(
|
|
915
|
+
propertyMapping: RelationFunctionPropertyMapping,
|
|
916
|
+
): V1_PropertyMapping {
|
|
917
|
+
return transformRelationFunctionPropertyMapping(propertyMapping);
|
|
918
|
+
}
|
|
888
919
|
}
|
|
889
920
|
|
|
890
921
|
const transformOperationType = (
|
|
@@ -1162,6 +1193,37 @@ const transformAggregationAwareSetImplementation = (
|
|
|
1162
1193
|
return classMapping;
|
|
1163
1194
|
};
|
|
1164
1195
|
|
|
1196
|
+
const transformRelationFunctionInstanceSetImplementation = (
|
|
1197
|
+
element: RelationFunctionInstanceSetImplementation,
|
|
1198
|
+
context: V1_GraphTransformerContext,
|
|
1199
|
+
): V1_RelationFunctionClassMapping => {
|
|
1200
|
+
const functionName = generateFunctionPrettyName(
|
|
1201
|
+
guaranteeNonNullable(element.relationFunction),
|
|
1202
|
+
{
|
|
1203
|
+
fullPath: true,
|
|
1204
|
+
spacing: false,
|
|
1205
|
+
notIncludeParamName: true,
|
|
1206
|
+
},
|
|
1207
|
+
);
|
|
1208
|
+
|
|
1209
|
+
const classMapping = new V1_RelationFunctionClassMapping();
|
|
1210
|
+
classMapping.relationFunction = new V1_PackageableElementPointer(
|
|
1211
|
+
PackageableElementPointerType.FUNCTION,
|
|
1212
|
+
functionName,
|
|
1213
|
+
);
|
|
1214
|
+
classMapping.id = mappingElementIdSerializer(element.id);
|
|
1215
|
+
classMapping.class = element.class.valueForSerialization ?? '';
|
|
1216
|
+
classMapping.root = element.root.valueForSerialization;
|
|
1217
|
+
|
|
1218
|
+
classMapping.propertyMappings = transformClassMappingPropertyMappings(
|
|
1219
|
+
element.propertyMappings,
|
|
1220
|
+
false,
|
|
1221
|
+
context,
|
|
1222
|
+
);
|
|
1223
|
+
classMapping.extendsClassMappingId = element.superSetImplementationId;
|
|
1224
|
+
return classMapping;
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1165
1227
|
// NOTE: this needs to be a function to avoid error with using before declaration for embedded property mappings due to the hoisting behavior in ES
|
|
1166
1228
|
function transformProperyMapping(
|
|
1167
1229
|
propertyMapping: PropertyMapping,
|
|
@@ -1279,6 +1341,15 @@ export class V1_SetImplementationTransformer
|
|
|
1279
1341
|
);
|
|
1280
1342
|
}
|
|
1281
1343
|
|
|
1344
|
+
visit_RelationFunctionInstanceSetImplementation(
|
|
1345
|
+
setImplementation: RelationFunctionInstanceSetImplementation,
|
|
1346
|
+
): V1_ClassMapping | undefined {
|
|
1347
|
+
return transformRelationFunctionInstanceSetImplementation(
|
|
1348
|
+
setImplementation,
|
|
1349
|
+
this.context,
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1282
1353
|
/**
|
|
1283
1354
|
* This test is skipped because we want to temporarily relax graph building algorithm
|
|
1284
1355
|
* to ease Pure -> Legend migration push.
|
|
@@ -86,7 +86,10 @@ import { V1_ClassInstance } from '../../../model/valueSpecification/raw/V1_Class
|
|
|
86
86
|
import { V1_ClassInstanceType } from '../../pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js';
|
|
87
87
|
import type { KeyExpressionInstanceValue } from '../../../../../../../graph/metamodel/pure/valueSpecification/KeyExpressionInstanceValue.js';
|
|
88
88
|
import { V1_CByteArray } from '../../../model/valueSpecification/raw/V1_CByteArray.js';
|
|
89
|
-
import type {
|
|
89
|
+
import type {
|
|
90
|
+
ColSpecArrayInstance,
|
|
91
|
+
ColSpecInstanceValue,
|
|
92
|
+
} from '../../../../../../../graph/metamodel/pure/valueSpecification/RelationValueSpecification.js';
|
|
90
93
|
import { V1_ColSpecArray } from '../../../model/valueSpecification/raw/classInstance/relation/V1_ColSpecArray.js';
|
|
91
94
|
import { V1_ColSpec } from '../../../model/valueSpecification/raw/classInstance/relation/V1_ColSpec.js';
|
|
92
95
|
import { RelationColumn } from '../../../../../../../graph/metamodel/pure/packageableElements/relation/RelationType.js';
|
|
@@ -424,6 +427,29 @@ class V1_ValueSpecificationTransformer
|
|
|
424
427
|
classInstance.value = colSpecArray;
|
|
425
428
|
return classInstance;
|
|
426
429
|
}
|
|
430
|
+
|
|
431
|
+
visit_ColSpecInstance(
|
|
432
|
+
valueSpecification: ColSpecInstanceValue,
|
|
433
|
+
): V1_ValueSpecification {
|
|
434
|
+
const classInstance = new V1_ClassInstance();
|
|
435
|
+
classInstance.type = V1_ClassInstanceType.COL_SPEC;
|
|
436
|
+
const val = guaranteeNonNullable(valueSpecification.values[0]);
|
|
437
|
+
const colProtocol = new V1_ColSpec();
|
|
438
|
+
colProtocol.name = val.name;
|
|
439
|
+
const fun1 = val.function1?.accept_ValueSpecificationVisitor(
|
|
440
|
+
new V1_ValueSpecificationTransformer(
|
|
441
|
+
this.inScope,
|
|
442
|
+
this.open,
|
|
443
|
+
this.isParameter,
|
|
444
|
+
this.useAppliedFunction,
|
|
445
|
+
),
|
|
446
|
+
);
|
|
447
|
+
if (fun1) {
|
|
448
|
+
colProtocol.function1 = guaranteeType(fun1, V1_Lambda);
|
|
449
|
+
}
|
|
450
|
+
classInstance.value = colProtocol;
|
|
451
|
+
return classInstance;
|
|
452
|
+
}
|
|
427
453
|
}
|
|
428
454
|
|
|
429
455
|
export function V1_transformGraphFetchTree(
|
|
@@ -52,6 +52,8 @@ import type { V1_MergeOperationClassMapping } from '../../../model/packageableEl
|
|
|
52
52
|
import { MergeOperationSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MergeOperationSetImplementation.js';
|
|
53
53
|
import type { V1_INTERNAL__UnknownClassMapping } from '../../../model/packageableElements/mapping/V1_INTERNAL__UnknownClassMapping.js';
|
|
54
54
|
import { INTERNAL__UnknownSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/INTERNAL__UnknownSetImplementation.js';
|
|
55
|
+
import type { V1_RelationFunctionClassMapping } from '../../../model/packageableElements/mapping/V1_RelationFunctionClassMapping.js';
|
|
56
|
+
import { RelationFunctionInstanceSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.js';
|
|
55
57
|
|
|
56
58
|
const getClassMappingOperationType = (value: string): OperationType =>
|
|
57
59
|
guaranteeNonNullable(
|
|
@@ -294,4 +296,20 @@ export class V1_ClassMappingFirstPassBuilder
|
|
|
294
296
|
);
|
|
295
297
|
return aggragetionAwareInstanceSetImplementation;
|
|
296
298
|
}
|
|
299
|
+
|
|
300
|
+
visit_RelationFunctionClassMapping(
|
|
301
|
+
classMapping: V1_RelationFunctionClassMapping,
|
|
302
|
+
): SetImplementation {
|
|
303
|
+
assertNonEmptyString(
|
|
304
|
+
classMapping.class,
|
|
305
|
+
`Relation function class mapping 'class' field is missing or empty`,
|
|
306
|
+
);
|
|
307
|
+
const targetClass = this.context.resolveClass(classMapping.class);
|
|
308
|
+
return new RelationFunctionInstanceSetImplementation(
|
|
309
|
+
V1_getInferredClassMappingId(targetClass.value, classMapping),
|
|
310
|
+
this.parent,
|
|
311
|
+
targetClass,
|
|
312
|
+
InferableMappingElementRootExplicitValue.create(classMapping.root),
|
|
313
|
+
);
|
|
314
|
+
}
|
|
297
315
|
}
|
|
@@ -67,6 +67,9 @@ import {
|
|
|
67
67
|
import type { DSL_Mapping_PureProtocolProcessorPlugin_Extension } from '../../../../extensions/DSL_Mapping_PureProtocolProcessorPlugin_Extension.js';
|
|
68
68
|
import type { V1_MergeOperationClassMapping } from '../../../model/packageableElements/mapping/V1_MergeOperationClassMapping.js';
|
|
69
69
|
import type { V1_INTERNAL__UnknownClassMapping } from '../../../model/packageableElements/mapping/V1_INTERNAL__UnknownClassMapping.js';
|
|
70
|
+
import type { V1_RelationFunctionClassMapping } from '../../../model/packageableElements/mapping/V1_RelationFunctionClassMapping.js';
|
|
71
|
+
import { RelationFunctionInstanceSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.js';
|
|
72
|
+
import { generateFunctionPrettyName } from '../../../../../../../graph/helpers/PureLanguageHelper.js';
|
|
70
73
|
|
|
71
74
|
export class V1_ClassMappingSecondPassBuilder
|
|
72
75
|
implements V1_ClassMappingVisitor<void>
|
|
@@ -365,4 +368,47 @@ export class V1_ClassMappingSecondPassBuilder
|
|
|
365
368
|
|
|
366
369
|
return aggragetionAwareInstanceSetImplementation;
|
|
367
370
|
}
|
|
371
|
+
|
|
372
|
+
visit_RelationFunctionClassMapping(
|
|
373
|
+
classMapping: V1_RelationFunctionClassMapping,
|
|
374
|
+
): SetImplementation {
|
|
375
|
+
assertNonEmptyString(
|
|
376
|
+
classMapping.class,
|
|
377
|
+
`Relation function class mapping 'class' field is missing or empty`,
|
|
378
|
+
);
|
|
379
|
+
const relationFunctionInstanceSetImplementation = guaranteeType(
|
|
380
|
+
getOwnClassMappingById(
|
|
381
|
+
this.parent,
|
|
382
|
+
V1_getInferredClassMappingId(
|
|
383
|
+
this.context.resolveClass(classMapping.class).value,
|
|
384
|
+
classMapping,
|
|
385
|
+
).value,
|
|
386
|
+
),
|
|
387
|
+
RelationFunctionInstanceSetImplementation,
|
|
388
|
+
);
|
|
389
|
+
relationFunctionInstanceSetImplementation.relationFunction =
|
|
390
|
+
guaranteeNonNullable(
|
|
391
|
+
this.context.graph.functions.find(
|
|
392
|
+
(fn) =>
|
|
393
|
+
generateFunctionPrettyName(fn, {
|
|
394
|
+
fullPath: true,
|
|
395
|
+
spacing: false,
|
|
396
|
+
notIncludeParamName: true,
|
|
397
|
+
}).replaceAll(/\s/gu, '') ===
|
|
398
|
+
classMapping.relationFunction.path.replaceAll(/\s/gu, ''),
|
|
399
|
+
),
|
|
400
|
+
);
|
|
401
|
+
relationFunctionInstanceSetImplementation.propertyMappings =
|
|
402
|
+
classMapping.propertyMappings.map((propertyMapping) =>
|
|
403
|
+
propertyMapping.accept_PropertyMappingVisitor(
|
|
404
|
+
new V1_PropertyMappingBuilder(
|
|
405
|
+
this.context,
|
|
406
|
+
relationFunctionInstanceSetImplementation,
|
|
407
|
+
relationFunctionInstanceSetImplementation,
|
|
408
|
+
getAllEnumerationMappings(this.parent),
|
|
409
|
+
),
|
|
410
|
+
),
|
|
411
|
+
);
|
|
412
|
+
return relationFunctionInstanceSetImplementation;
|
|
413
|
+
}
|
|
368
414
|
}
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.ts
CHANGED
|
@@ -81,6 +81,8 @@ import { INTERNAL__UnknownElement } from '../../../../../../../graph/metamodel/p
|
|
|
81
81
|
import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
|
|
82
82
|
import { HostedService } from '../../../../../../../graph/metamodel/pure/packageableElements/function/HostedService.js';
|
|
83
83
|
import { V1_buildFunctionActivatorActions } from './helpers/V1_LegendLambdaHelper.js';
|
|
84
|
+
import { GenericTypeImplicitReference } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/GenericTypeReference.js';
|
|
85
|
+
import { GenericType } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/GenericType.js';
|
|
84
86
|
|
|
85
87
|
export class V1_ElementFirstPassBuilder
|
|
86
88
|
implements V1_PackageableElementVisitor<PackageableElement>
|
|
@@ -438,7 +440,10 @@ export class V1_ElementFirstPassBuilder
|
|
|
438
440
|
const func = new ConcreteFunctionDefinition(
|
|
439
441
|
name,
|
|
440
442
|
// This is just a stub to fill in when we first create the function
|
|
441
|
-
|
|
443
|
+
GenericTypeImplicitReference.create(
|
|
444
|
+
PackageableElementImplicitReference.create(PrimitiveType.STRING, ''),
|
|
445
|
+
new GenericType(PrimitiveType.STRING),
|
|
446
|
+
),
|
|
442
447
|
Multiplicity.ZERO_MANY,
|
|
443
448
|
);
|
|
444
449
|
const path = V1_buildFullPath(element.package, name);
|