diff --git a/.changeset/soft-candles-obey.md b/.changeset/soft-candles-obey.md new file mode 100644 index 00000000000..006955d16e0 --- /dev/null +++ b/.changeset/soft-candles-obey.md @@ -0,0 +1,4 @@ +--- +'@finos/legend-extension-dsl-persistence': patch +'@finos/legend-graph': patch +--- diff --git a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Persistence.ts b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Persistence.ts index 8c67ab5af6d..6561c271450 100644 --- a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Persistence.ts +++ b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Persistence.ts @@ -19,6 +19,7 @@ import type { V1_Persister } from './V1_DSL_Persistence_Persister.js'; import type { V1_Trigger } from './V1_DSL_Persistence_Trigger.js'; import { V1_PackageableElement, + type V1_PackageableElementPointer, type V1_PackageableElementVisitor, } from '@finos/legend-graph'; import { type Hashable, hashArray } from '@finos/legend-shared'; @@ -29,7 +30,7 @@ import type { V1_ServiceOutputTarget as V1_ServiceOutputTarget } from './V1_DSL_ export class V1_Persistence extends V1_PackageableElement implements Hashable { documentation!: string; trigger!: V1_Trigger; - service!: string; + service!: V1_PackageableElementPointer; persister?: V1_Persister | undefined; serviceOutputTargets?: V1_ServiceOutputTarget[] | undefined; notifier!: V1_Notifier; @@ -40,7 +41,7 @@ export class V1_Persistence extends V1_PackageableElement implements Hashable { PERSISTENCE_HASH_STRUCTURE.PERSISTENCE, this.documentation, this.trigger, - this.service, + this.service.path, hashArray(this.serviceOutputTargets ?? []), this.persister ?? '', this.notifier, diff --git a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_PersistentTarget.ts b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_PersistentTarget.ts index 874b2351ef8..0d9d22d7ff5 100644 --- a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_PersistentTarget.ts +++ b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_PersistentTarget.ts @@ -17,6 +17,7 @@ import { type Hashable, hashArray } from '@finos/legend-shared'; import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../../../graph/DSL_Persistence_HashUtils.js'; import type { V1_Temporality } from './V1_DSL_Persistence_Temporality.js'; +import type { V1_PackageableElementPointer } from '@finos/legend-graph'; export abstract class V1_PersistenceTarget implements Hashable { abstract get hashCode(): string; @@ -27,14 +28,14 @@ export class V1_RelationalPersistenceTarget implements Hashable { table!: string; - database!: string; + database!: V1_PackageableElementPointer; temporality!: V1_Temporality; get hashCode(): string { return hashArray([ PERSISTENCE_HASH_STRUCTURE.RELATIONAL_PERSISTENCE_TARGET, this.table, - this.database, + this.database.path, this.temporality, ]); } diff --git a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Sink.ts b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Sink.ts index 2e50d9f683b..f154fd1fccf 100644 --- a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Sink.ts +++ b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/model/packageableElements/persistence/V1_DSL_Persistence_Sink.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import type { V1_PackageableElementPointer } from '@finos/legend-graph'; import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../../../graph/DSL_Persistence_HashUtils.js'; import { type Hashable, hashArray } from '@finos/legend-shared'; @@ -22,23 +23,23 @@ export abstract class V1_Sink implements Hashable { } export class V1_RelationalSink extends V1_Sink implements Hashable { - database!: string; + database!: V1_PackageableElementPointer; override get hashCode(): string { return hashArray([ PERSISTENCE_HASH_STRUCTURE.RELATIONAL_SINK, - this.database, + this.database.path, ]); } } export class V1_ObjectStorageSink extends V1_Sink implements Hashable { - binding!: string; + binding!: V1_PackageableElementPointer; override get hashCode(): string { return hashArray([ PERSISTENCE_HASH_STRUCTURE.OBJECT_STORAGE_SINK, - this.binding, + this.binding.path, ]); } } diff --git a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DSL_Persistence_TransformerHelper.ts b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DSL_Persistence_TransformerHelper.ts index 339fb8ab2fb..4c5f039c9a9 100644 --- a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DSL_Persistence_TransformerHelper.ts +++ b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DSL_Persistence_TransformerHelper.ts @@ -154,6 +154,8 @@ import { V1_transformEmbeddedData, V1_transformTestAssertion, V1_transformAtomicTest, + PackageableElementPointerType, + V1_PackageableElementPointer, } from '@finos/legend-graph'; import { guaranteeType, UnsupportedOperationError } from '@finos/legend-shared'; import type { PersistenceTestBatch } from '../../../../../../../graph/metamodel/pure/model/packageableElements/persistence/DSL_Persistence_PersistenceTestBatch.js'; @@ -357,7 +359,10 @@ export const V1_transformRelationalSink = ( context: V1_GraphTransformerContext, ): V1_RelationalSink => { const protocol = new V1_RelationalSink(); - protocol.database = element.database.value.path; + protocol.database = new V1_PackageableElementPointer( + PackageableElementPointerType.STORE, + element.database.value.path, + ); return protocol; }; @@ -366,7 +371,10 @@ export const V1_transformObjectStorageSink = ( context: V1_GraphTransformerContext, ): V1_ObjectStorageSink => { const protocol = new V1_ObjectStorageSink(); - protocol.binding = element.binding.value.path; + protocol.binding = new V1_PackageableElementPointer( + PackageableElementPointerType.BINDING, + element.binding.value.path, + ); return protocol; }; @@ -963,7 +971,11 @@ export const V1_transformPersistenceTarget = ( ): V1_PersistenceTarget => { if (element instanceof RelationalPersistenceTarget) { const protocol = new V1_RelationalPersistenceTarget(); - protocol.database = element.database; + protocol.database = new V1_PackageableElementPointer( + PackageableElementPointerType.STORE, + element.database, + ); + protocol.table = element.table; protocol.temporality = V1_transformTemporality( element.temporality, @@ -1252,7 +1264,10 @@ export const V1_transformPersistence = ( protocol.documentation = element.documentation; protocol.notifier = V1_transformNotifier(element.notifier, context); protocol.persister = V1_transformPersister(element.persister, context); - protocol.service = element.service.valueForSerialization ?? ''; + protocol.service = new V1_PackageableElementPointer( + PackageableElementPointerType.SERVICE, + element.service.valueForSerialization ?? '', + ); protocol.serviceOutputTargets = V1_transformServiceOutputTargets( element.serviceOutputTargets, context, diff --git a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_DSL_Persistence_BuilderHelper.ts b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_DSL_Persistence_BuilderHelper.ts index 28f1a90e717..fcd9f15ebe7 100644 --- a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_DSL_Persistence_BuilderHelper.ts +++ b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_DSL_Persistence_BuilderHelper.ts @@ -159,6 +159,7 @@ import { V1_buildFullPath, V1_EqualToJson, type V1_GraphBuilderContext, + V1_PackageableElementPointer, type V1_TestAssertion, } from '@finos/legend-graph'; import { @@ -368,7 +369,7 @@ export const V1_buildRelationalSink = ( ): RelationalSink => { const sink = new RelationalSink(); sink.database = context.resolveElement( - protocol.database, + protocol.database.path, false, ) as PackageableElementImplicitReference; return sink; @@ -380,7 +381,7 @@ export const V1_buildObjectStorageSink = ( ): ObjectStorageSink => { const sink = new ObjectStorageSink(); sink.binding = context.resolveElement( - protocol.binding, + protocol.binding.path, false, ) as PackageableElementImplicitReference; return sink; @@ -1164,7 +1165,7 @@ export const V1_buildPersistenceTarget = ( ): PersistenceTarget => { if (protocol instanceof V1_RelationalPersistenceTarget) { const persistentTarget = new RelationalPersistenceTarget(); - persistentTarget.database = protocol.database; + persistentTarget.database = protocol.database.path; persistentTarget.table = protocol.table; persistentTarget.temporality = V1_buildTemporality( protocol.temporality, @@ -1222,7 +1223,7 @@ export const V1_buildPersistence = ( ); persistence.notifier = V1_buildNotifier(protocol.notifier, context); persistence.persister = V1_buildPersister(protocol.persister, context); - persistence.service = context.resolveService(protocol.service); + persistence.service = context.resolveService(protocol.service.path); persistence.serviceOutputTargets = V1_buildServiceOutputTargets( protocol.serviceOutputTargets, context, diff --git a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_Persistence_ProtocolHelper.ts b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_Persistence_ProtocolHelper.ts index 404156eefb1..4b1e07aa326 100644 --- a/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_Persistence_ProtocolHelper.ts +++ b/packages/legend-extension-dsl-persistence/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_Persistence_ProtocolHelper.ts @@ -92,6 +92,9 @@ import { V1_externalFormatDataModelSchema, V1_serializeAtomicTest, V1_deserializeAtomicTest, + V1_packageableElementPointerModelSchema, + V1_serializePackageableElementPointer, + PackageableElementPointerType, } from '@finos/legend-graph'; import { type PlainObject, @@ -777,7 +780,14 @@ const V1_relationalSinkModelSchema = ( ): ModelSchema => createModelSchema(V1_RelationalSink, { _type: usingConstantValueSchema(V1_SinkType.RELATIONAL_SINK), - database: primitive(), + database: custom( + (val) => serialize(V1_packageableElementPointerModelSchema, val), + (val) => + V1_serializePackageableElementPointer( + val, + PackageableElementPointerType.STORE, + ), + ), }); const V1_objectStorageSinkModelSchema = ( @@ -785,7 +795,14 @@ const V1_objectStorageSinkModelSchema = ( ): ModelSchema => createModelSchema(V1_ObjectStorageSink, { _type: usingConstantValueSchema(V1_SinkType.OBJECT_STORAGE_SINK), - binding: primitive(), + binding: custom( + (val) => serialize(V1_packageableElementPointerModelSchema, val), + (val) => + V1_serializePackageableElementPointer( + val, + PackageableElementPointerType.BINDING, + ), + ), }); export const V1_serializeSink = ( @@ -1599,7 +1616,14 @@ export const V1_relationalPersistenceTargetModelSchema = ( _type: usingConstantValueSchema( V1_PersistentTargetType.RELATIONAL_PERSISTENCE_TARGET, ), - database: primitive(), + database: custom( + (val) => serialize(V1_packageableElementPointerModelSchema, val), + (val) => + V1_serializePackageableElementPointer( + val, + PackageableElementPointerType.STORE, + ), + ), table: primitive(), temporality: custom( (val) => V1_serializeTemporality(val, plugins), @@ -2134,7 +2158,14 @@ export const V1_persistenceModelSchema = ( (val) => V1_serializePersister(val, plugins), (val) => V1_deserializePersister(val, plugins), ), - service: primitive(), + service: custom( + (val) => serialize(V1_packageableElementPointerModelSchema, val), + (val) => + V1_serializePackageableElementPointer( + val, + PackageableElementPointerType.SERVICE, + ), + ), serviceOutputTargets: optionalCustomList( (val: V1_ServiceOutputTarget) => V1_serializeServiceOutputTarget(val, plugins), diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Profile.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Profile.ts index cc0cffeef65..2eeb64d33fb 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Profile.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Profile.ts @@ -21,16 +21,31 @@ import { V1_PackageableElement, } from '../../../model/packageableElements/V1_PackageableElement.js'; +export class V1_ProfileStereotype { + value!: string; + + constructor(value: string) { + this.value = value; + } +} + +export class V1_ProfileTag { + value!: string; + constructor(value: string) { + this.value = value; + } +} + export class V1_Profile extends V1_PackageableElement implements Hashable { - stereotypes: string[] = []; - tags: string[] = []; + stereotypes: V1_ProfileStereotype[] = []; + tags: V1_ProfileTag[] = []; override get hashCode(): string { return hashArray([ CORE_HASH_STRUCTURE.PROFILE, this.path, - hashArray(this.stereotypes), - hashArray(this.tags), + hashArray(this.stereotypes.map((e) => e.value)), + hashArray(this.tags.map((e) => e.value)), ]); } diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_EnumerationMapping.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_EnumerationMapping.ts index 2a2cd2ad1fb..a90ec6becf1 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_EnumerationMapping.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_EnumerationMapping.ts @@ -24,10 +24,11 @@ import { type V1_EnumValueMapping, V1_getEnumValueMappingSourceValueType, } from '../../../model/packageableElements/mapping/V1_EnumValueMapping.js'; +import type { V1_PackageableElementPointer } from '../V1_PackageableElement.js'; export class V1_EnumerationMapping implements Hashable { id?: string | undefined; - enumeration!: string; + enumeration!: V1_PackageableElementPointer; /** * NOTE: the order is important, during deserialization, we want sourceType to be already available * @deprecated since v1_11_0 @@ -41,7 +42,7 @@ export class V1_EnumerationMapping implements Hashable { return hashArray([ CORE_HASH_STRUCTURE.ENUMERATION_MAPPING, this.id ?? '', - this.enumeration, + this.enumeration.path, // NOTE: older protocol formats have information about source type so we have to account for those, // otherwise, we don't need to account for the source type in hash computation // If there is no enum value mapping, ignore the source type since it's synthetic and used by the editor diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts index e20755af3a3..6be74a31e7f 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts @@ -29,7 +29,11 @@ import type { Class } from '../../../../../../../graph/metamodel/pure/packageabl import type { Association } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/Association.js'; import type { ConcreteFunctionDefinition } from '../../../../../../../graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js'; import type { Property } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/Property.js'; -import { V1_Profile } from '../../../model/packageableElements/domain/V1_Profile.js'; +import { + V1_Profile, + V1_ProfileStereotype, + V1_ProfileTag, +} from '../../../model/packageableElements/domain/V1_Profile.js'; import { V1_StereotypePtr } from '../../../model/packageableElements/domain/V1_StereotypePtr.js'; import { V1_initPackageableElement, @@ -88,8 +92,10 @@ export const V1_createRawGenericTypeWithElementPath = ( export const V1_transformProfile = (element: Profile): V1_Profile => { const profile = new V1_Profile(); V1_initPackageableElement(profile, element); - profile.stereotypes = element.p_stereotypes.map((s) => s.value); - profile.tags = element.p_tags.map((t) => t.value); + profile.stereotypes = element.p_stereotypes.map( + (s) => new V1_ProfileStereotype(s.value), + ); + profile.tags = element.p_tags.map((t) => new V1_ProfileTag(t.value)); return profile; }; diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts index b2fbb644c06..3420a153395 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts @@ -247,8 +247,10 @@ const transformEnumerationMapping = ( enumerationMapping.enumValueMappings = element.enumValueMappings .filter((e) => !isStubbed_EnumValueMapping(e)) .map(transformEnumValueMapping); - enumerationMapping.enumeration = - element.enumeration.valueForSerialization ?? ''; + enumerationMapping.enumeration = new V1_PackageableElementPointer( + PackageableElementPointerType.ENUMERATION, + element.enumeration.valueForSerialization ?? '', + ); enumerationMapping.id = mappingElementIdSerializer(element.id); return enumerationMapping; }; diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts index d7faad563ba..550d99ad94d 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts @@ -240,7 +240,8 @@ export class V1_ElementSecondPassBuilder V1_buildFullPath(element.package, element.name), ); const uniqueStereotypes = new Set(); - profile.p_stereotypes = element.stereotypes.map((stereotype) => { + profile.p_stereotypes = element.stereotypes.map((stereotypeV) => { + const stereotype = stereotypeV.value; if (uniqueStereotypes.has(stereotype)) { const message = `Found duplicated stereotype '${stereotype}' in profile '${element.path}'`; /** @@ -258,7 +259,8 @@ export class V1_ElementSecondPassBuilder return new Stereotype(profile, stereotype); }); const uniqueTags = new Set(); - profile.p_tags = element.tags.map((tag) => { + profile.p_tags = element.tags.map((tagV) => { + const tag = tagV.value; if (uniqueTags.has(tag)) { const message = `Found duplicated tag '${tag}' in profile '${element.path}'`; /** diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts index 24bad85bb6b..413360a2598 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts @@ -154,11 +154,11 @@ export const V1_buildEnumerationMapping = ( parentMapping: Mapping, ): EnumerationMapping => { assertNonEmptyString( - srcEnumerationMapping.enumeration, + srcEnumerationMapping.enumeration.path, `Enumeration mapping 'enumeration' field is missing or empty`, ); const targetEnumeration = context.resolveEnumeration( - srcEnumerationMapping.enumeration, + srcEnumerationMapping.enumeration.path, ); const possibleSourceTypes = new Set( srcEnumerationMapping.enumValueMappings.flatMap((enumValueMapping) => diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts index 1ce73deb453..384ae5eca02 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts @@ -25,6 +25,7 @@ import { type ModelSchema, serialize, custom, + deserialize, } from 'serializr'; import { customList, @@ -32,6 +33,8 @@ import { optionalCustom, usingConstantValueSchema, usingModelSchema, + isString, + type PlainObject, } from '@finos/legend-shared'; import { V1_multiplicityModelSchema, @@ -39,7 +42,11 @@ import { V1_serializePackageableElementPointer, } from '../../../transformation/pureProtocol/serializationHelpers/V1_CoreSerializationHelper.js'; import { V1_Enumeration } from '../../../model/packageableElements/domain/V1_Enumeration.js'; -import { V1_Profile } from '../../../model/packageableElements/domain/V1_Profile.js'; +import { + V1_Profile, + V1_ProfileStereotype, + V1_ProfileTag, +} from '../../../model/packageableElements/domain/V1_Profile.js'; import { V1_Measure, V1_Unit, @@ -120,12 +127,48 @@ export const V1_taggedValueModelSchema = createModelSchema(V1_TaggedValue, { value: primitive(), }); +const V1_ProfileStereotypeSchema = createModelSchema(V1_ProfileStereotype, { + value: primitive(), +}); + +const V1_ProfileTagSchema = createModelSchema(V1_ProfileTag, { + value: primitive(), +}); + +export const V1_serializeProfileStereotypeSchema = ( + json: PlainObject | string, +): V1_ProfileTag => { + if (isString(json)) { + return new V1_ProfileStereotype(json); + } + return deserialize(V1_ProfileStereotypeSchema, json); +}; + +export const V1_serializeProfileTagSchema = ( + json: PlainObject | string, +): V1_ProfileTag => { + if (isString(json)) { + return new V1_ProfileTag(json); + } + return deserialize(V1_ProfileTagSchema, json); +}; + export const V1_profileModelSchema = createModelSchema(V1_Profile, { _type: usingConstantValueSchema(V1_PROFILE_ELEMENT_PROTOCOL_TYPE), name: primitive(), package: primitive(), - stereotypes: list(primitive()), - tags: list(primitive()), + stereotypes: customList( + (val: V1_ProfileStereotype) => serialize(V1_ProfileStereotypeSchema, val), + (val) => V1_serializeProfileStereotypeSchema(val), + + { INTERNAL__forceReturnEmptyInTest: true }, + ), + tags: customList( + (val: V1_ProfileTag) => serialize(V1_ProfileTagSchema, val), + (val) => V1_serializeProfileTagSchema(val), + + { INTERNAL__forceReturnEmptyInTest: true }, + ), }); // ------------------------------------- Enumeration ------------------------------------- diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts index 96be60c722f..a829954291c 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts @@ -962,7 +962,14 @@ const relationalAssociationMappingModelschema = createModelSchema( V1_RelationalAssociationMapping, { _type: usingConstantValueSchema(V1_AssociationMappingType.RELATIONAL), - association: primitive(), + association: custom( + (val) => serialize(V1_packageableElementPointerModelSchema, val), + (val) => + V1_serializePackageableElementPointer( + val, + PackageableElementPointerType.ASSOCIATION, + ), + ), id: optional(primitive()), propertyMappings: list( custom( @@ -978,7 +985,14 @@ const flatDataAssociationMappingModelschema = createModelSchema( V1_FlatDataAssociationMapping, { _type: usingConstantValueSchema(V1_AssociationMappingType.FLAT_DATA), - association: primitive(), + association: custom( + (val) => serialize(V1_packageableElementPointerModelSchema, val), + (val) => + V1_serializePackageableElementPointer( + val, + PackageableElementPointerType.ASSOCIATION, + ), + ), id: optional(primitive()), propertyMappings: list( custom( @@ -1184,7 +1198,14 @@ const V1_enumerationMappingModelSchema = createModelSchema( ), ), ), - enumeration: primitive(), + enumeration: custom( + (val) => serialize(V1_packageableElementPointerModelSchema, val), + (val) => + V1_serializePackageableElementPointer( + val, + PackageableElementPointerType.ENUMERATION, + ), + ), id: optional(primitive()), }, ); diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.ts index 27056ebda9d..a4c679cad57 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.ts @@ -23,6 +23,7 @@ import { custom, alias, optional, + SKIP, } from 'serializr'; import { type PlainObject, @@ -98,7 +99,14 @@ const V1_RawGenericTypeSchemaModelInner = createModelSchema(V1_RawGenericType, { INTERNAL__forceReturnEmptyInTest: true, }, ), - // typeVariableValues: TODO + typeVariableValues: optionalCustomList( + // TODO + (value) => SKIP, + (value) => SKIP, + { + INTERNAL__forceReturnEmptyInTest: true, + }, + ), }); const V1_RawGenericTypeSchemaModel = createModelSchema(V1_RawGenericType, { @@ -116,7 +124,14 @@ const V1_RawGenericTypeSchemaModel = createModelSchema(V1_RawGenericType, { INTERNAL__forceReturnEmptyInTest: true, }, ), - // typeVariableValues: TODO + typeVariableValues: optionalCustomList( + // TODO + (value) => SKIP, + (value) => SKIP, + { + INTERNAL__forceReturnEmptyInTest: true, + }, + ), }); const V1_deserializeRawGenericType = ( diff --git a/packages/legend-graph/src/graph/MetaModelConst.ts b/packages/legend-graph/src/graph/MetaModelConst.ts index 92bd2ee415e..f87b8194c38 100644 --- a/packages/legend-graph/src/graph/MetaModelConst.ts +++ b/packages/legend-graph/src/graph/MetaModelConst.ts @@ -161,7 +161,9 @@ export enum PackageableElementPointerType { FILE_GENERATION = 'FILE_GENERATION', SERVICE = 'SERVICE', DATA = 'DATA', + ENUMERATION = 'ENUMERATION', ASSOCIATION = 'ASSOCIATION', + BINDING = 'BINDING', } export enum SUPPORTED_FUNCTIONS { diff --git a/packages/legend-manual-tests/src/__tests__/roundtrip-grammar/RoundtripGrammar.engine-roundtrip-test.ts b/packages/legend-manual-tests/src/__tests__/roundtrip-grammar/RoundtripGrammar.engine-roundtrip-test.ts index 7e1b6e5a35e..df72b1f1ac7 100644 --- a/packages/legend-manual-tests/src/__tests__/roundtrip-grammar/RoundtripGrammar.engine-roundtrip-test.ts +++ b/packages/legend-manual-tests/src/__tests__/roundtrip-grammar/RoundtripGrammar.engine-roundtrip-test.ts @@ -305,9 +305,7 @@ const cases: [string, string, boolean][] = fs .readdirSync(TEST_CASE_DIR) .map((caseName) => resolve(TEST_CASE_DIR, caseName)) .filter((filePath) => fs.statSync(filePath).isFile()) - .filter( - (filePath) => basename(filePath) === 'STO_ServiceStore-path-offset.pure', - ) + // .filter((filePath) => basename(filePath) === 'DSL_PersistenceV2-basic.pure') .map((filePath) => [ testNameFrom(filePath), filePath, @@ -318,7 +316,7 @@ describe('Grammar roundtrip test', () => { test.each(cases)('%s', async (testName, filePath, isSkipped) => { if (!isSkipped) { await checkGrammarRoundtrip(testName, filePath, { - debug: false, + debug: true, }); } }); diff --git a/packages/legend-manual-tests/x.json b/packages/legend-manual-tests/x.json index 21a0752eecd..41789501663 100644 --- a/packages/legend-manual-tests/x.json +++ b/packages/legend-manual-tests/x.json @@ -1,32 +1,599 @@ [ + { + "_type": "snowflakeApp", + "actions": [], + "activationConfiguration": { + "_type": "snowflakeDeploymentConfiguration", + "activationConnection": { + "_type": "connectionPointer", + "connection": "model::SnowFlakeConnection" + } + }, + "applicationName": "", + "function": { + "path": "model::Firm_QueryFunction():TabularDataSet[1]", + "type": "FUNCTION" + }, + "name": "NewActivator", + "ownership": { + "_type": "DeploymentOwner", + "id": "user" + }, + "package": "model", + "stereotypes": [], + "taggedValues": [] + }, + { + "_type": "snowflakeApp", + "actions": [], + "activationConfiguration": { + "_type": "snowflakeDeploymentConfiguration", + "activationConnection": { + "_type": "connectionPointer", + "connection": "model::SnowFlakeConnection" + } + }, + "applicationName": "", + "function": { + "path": "model::Firm_QueryFunction(String[1]):TabularDataSet[1]", + "type": "FUNCTION" + }, + "name": "NewActivatorWithParam", + "ownership": { + "_type": "DeploymentOwner", + "id": "user" + }, + "package": "model", + "stereotypes": [ + { + "profile": "equality", + "value": "Key" + } + ], + "taggedValues": [] + }, { "_type": "relational", "filters": [], "includedStores": [], - "joins": [], - "name": "db", + "joins": [ + { + "name": "FirmPerson", + "operation": { + "_type": "dynaFunc", + "funcName": "equal", + "parameters": [Array + ] + } + }, + { + "name": "FirmAddress", + "operation": { + "_type": "dynaFunc", + "funcName": "equal", + "parameters": [Array + ] + } + }, + { + "name": "HobbyPerson", + "operation": { + "_type": "dynaFunc", + "funcName": "equal", + "parameters": [Array + ] + } + } + ], + "name": "TestDB", "package": "store", - "schemas": [], + "schemas": [ + { + "name": "default", + "tables": [ + [Object + ], + [Object + ], + [Object + ], + [Object + ] + ], + "views": [] + } + ], "stereotypes": [] }, { - "_type": "connection", - "connectionValue": { - "_type": "RelationalDatabaseConnection", - "authenticationStrategy": { "_type": "gcpApplicationDefaultCredentials" }, - "databaseType": "Spanner", - "datasourceSpecification": { - "_type": "spanner", - "databaseId": "test-db", - "instanceId": "test-instance", - "projectId": "test-project" - }, - "element": "store::db", - "postProcessorWithParameter": [], - "postProcessors": [], - "type": "Spanner" - }, - "name": "spanner", - "package": "connection" - } -] + "_type": "class", + "constraints": [], + "name": "Firm", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "legalName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 0 + }, + "name": "employees", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 0 + }, + "name": "contractors", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1 + }, + "name": "address", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "id", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "class", + "constraints": [], + "name": "Hobby", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "name", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "id", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "class", + "constraints": [], + "name": "Person", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "firstName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "lastName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 0 + }, + "name": "hobbies", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "class", + "constraints": [], + "name": "Address", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "streetName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "pincode", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [ + { + "profile": "meta::pure::profiles::temporal", + "value": "businesstemporal" + } + ], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "function", + "body": [ + { + "_type": "func", + "function": "from", + "parameters": [ + [Object + ], + [Object + ], + [Object + ] + ] + } + ], + "name": "Firm_QueryFunction__TabularDataSet_1_", + "package": "model", + "parameters": [], + "postConstraints": [], + "preConstraints": [], + "returnGenericType": { + "multiplicityArguments": [], + "rawType": { + "_type": "packageableType", + "fullPath": "meta::pure::tds::TabularDataSet" + }, + "typeArguments": [], + "typeVariableValues": [] + }, + "returnMultiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "stereotypes": [], + "taggedValues": [], + "tests": [] + }, + { + "_type": "function", + "body": [ + { + "_type": "func", + "function": "from", + "parameters": [ + [Object + ], + [Object + ], + [Object + ] + ] + } + ], + "name": "Firm_QueryFunction_String_1__TabularDataSet_1_", + "package": "model", + "parameters": [ + { + "_type": "var", + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "param" + } + ], + "postConstraints": [], + "preConstraints": [], + "returnGenericType": { + "multiplicityArguments": [], + "rawType": { + "_type": "packageableType", + "fullPath": "meta::pure::tds::TabularDataSet" + }, + "typeArguments": [], + "typeVariableValues": [] + }, + "returnMultiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "stereotypes": [], + "taggedValues": [], + "tests": [] + }, + { + "_type": "mapping", + "associationMappings": [], + "classMappings": [ + { + "_type": "relational", + "class": "model::Person", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "PersonTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ], + [Object + ] + ], + "root": true + }, + { + "_type": "relational", + "class": "model::Firm", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "FirmTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ], + [Object + ], + [Object + ], + [Object + ] + ], + "root": true + }, + { + "_type": "relational", + "class": "model::Hobby", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "HobbyTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ] + ], + "root": true + }, + { + "_type": "relational", + "class": "model::Address", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "AddressTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ] + ], + "root": true + } + ], + "enumerationMappings": [], + "includedMappings": [], + "name": "RelationalMapping", + "package": "execution", + "tests": [] + }, … +] \ No newline at end of file diff --git a/packages/legend-manual-tests/x2.json b/packages/legend-manual-tests/x2.json index 8d5b1cbb017..be3ded8481b 100644 --- a/packages/legend-manual-tests/x2.json +++ b/packages/legend-manual-tests/x2.json @@ -1,31 +1,597 @@ [ + { + "_type": "snowflakeApp", + "actions": [], + "activationConfiguration": { + "_type": "snowflakeDeploymentConfiguration", + "activationConnection": { + "_type": "connectionPointer", + "connection": "model::SnowFlakeConnection" + } + }, + "applicationName": "", + "function": { + "path": "model::Firm_QueryFunction():TabularDataSet[1]", + "type": "FUNCTION" + }, + "name": "NewActivator", + "ownership": { + "_type": "DeploymentOwner", + "id": "user" + }, + "package": "model", + "stereotypes": [], + "taggedValues": [] + }, + { + "_type": "snowflakeApp", + "actions": [], + "activationConfiguration": { + "_type": "snowflakeDeploymentConfiguration", + "activationConnection": { + "_type": "connectionPointer", + "connection": "model::SnowFlakeConnection" + } + }, + "applicationName": "", + "function": { + "path": "model::Firm_QueryFunction(String[1]):TabularDataSet[1]", + "type": "FUNCTION" + }, + "name": "NewActivatorWithParam", + "ownership": { + "_type": "DeploymentOwner", + "id": "user" + }, + "package": "model", + "stereotypes": [ + { + "profile": "equality", + "value": "Key" + } + ], + "taggedValues": [] + }, { "_type": "relational", "filters": [], "includedStores": [], - "joins": [], - "name": "db", + "joins": [ + { + "name": "FirmPerson", + "operation": { + "_type": "dynaFunc", + "funcName": "equal", + "parameters": [Array + ] + } + }, + { + "name": "FirmAddress", + "operation": { + "_type": "dynaFunc", + "funcName": "equal", + "parameters": [Array + ] + } + }, + { + "name": "HobbyPerson", + "operation": { + "_type": "dynaFunc", + "funcName": "equal", + "parameters": [Array + ] + } + } + ], + "name": "TestDB", "package": "store", - "schemas": [], + "schemas": [ + { + "name": "default", + "tables": [ + [Object + ], + [Object + ], + [Object + ], + [Object + ] + ], + "views": [] + } + ], "stereotypes": [] }, { - "_type": "connection", - "connectionValue": { - "_type": "RelationalDatabaseConnection", - "authenticationStrategy": { "_type": "gcpApplicationDefaultCredentials" }, - "databaseType": "Spanner", - "datasourceSpecification": { - "_type": "spanner", - "databaseId": "test-db", - "instanceId": "test-instance", - "projectId": "test-project" - }, - "element": "store::db", - "postProcessorWithParameter": [], - "type": "Spanner" - }, - "name": "spanner", - "package": "connection" - } -] + "_type": "class", + "constraints": [], + "name": "Firm", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "legalName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 0 + }, + "name": "employees", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 0 + }, + "name": "contractors", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1 + }, + "name": "address", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "id", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "class", + "constraints": [], + "name": "Hobby", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "name", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "id", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "class", + "constraints": [], + "name": "Person", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "firstName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "lastName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 0 + }, + "name": "hobbies", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "class", + "constraints": [], + "name": "Address", + "originalMilestonedProperties": [], + "package": "model", + "properties": [ + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "streetName", + "stereotypes": [], + "taggedValues": [] + }, + { + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ], + "typeVariableValues": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "pincode", + "stereotypes": [], + "taggedValues": [] + } + ], + "qualifiedProperties": [], + "stereotypes": [ + { + "profile": "meta::pure::profiles::temporal", + "value": "businesstemporal" + } + ], + "superTypes": [], + "taggedValues": [] + }, + { + "_type": "function", + "body": [ + { + "_type": "func", + "function": "from", + "parameters": [ + [Object + ], + [Object + ], + [Object + ] + ] + } + ], + "name": "Firm_QueryFunction__TabularDataSet_1_", + "package": "model", + "parameters": [], + "postConstraints": [], + "preConstraints": [], + "returnGenericType": { + "multiplicityArguments": [], + "rawType": { + "_type": "packageableType", + "fullPath": "meta::pure::tds::TabularDataSet" + }, + "typeArguments": [], + "typeVariableValues": [] + }, + "returnMultiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "stereotypes": [], + "taggedValues": [], + "tests": [] + }, + { + "_type": "function", + "body": [ + { + "_type": "func", + "function": "from", + "parameters": [ + [Object + ], + [Object + ], + [Object + ] + ] + } + ], + "name": "Firm_QueryFunction_String_1__TabularDataSet_1_", + "package": "model", + "parameters": [ + { + "_type": "var", + "genericType": { + "multiplicityArguments": [Array + ], + "rawType": [Object + ], + "typeArguments": [Array + ] + }, + "multiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "name": "param" + } + ], + "postConstraints": [], + "preConstraints": [], + "returnGenericType": { + "multiplicityArguments": [], + "rawType": { + "_type": "packageableType", + "fullPath": "meta::pure::tds::TabularDataSet" + }, + "typeArguments": [], + "typeVariableValues": [] + }, + "returnMultiplicity": { + "lowerBound": 1, + "upperBound": 1 + }, + "stereotypes": [], + "taggedValues": [], + "tests": [] + }, + { + "_type": "mapping", + "associationMappings": [], + "classMappings": [ + { + "_type": "relational", + "class": "model::Person", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "PersonTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ], + [Object + ] + ], + "root": true + }, + { + "_type": "relational", + "class": "model::Firm", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "FirmTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ], + [Object + ], + [Object + ], + [Object + ] + ], + "root": true + }, + { + "_type": "relational", + "class": "model::Hobby", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "HobbyTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ] + ], + "root": true + }, + { + "_type": "relational", + "class": "model::Address", + "distinct": false, + "groupBy": [], + "mainTable": { + "_type": "Table", + "database": "store::TestDB", + "mainTableDb": "store::TestDB", + "schema": "default", + "table": "AddressTable" + }, + "primaryKey": [ + [Object + ] + ], + "propertyMappings": [ + [Object + ], + [Object + ] + ], + "root": true + } + ], + "enumerationMappings": [], + "includedMappings": [], + "name": "RelationalMapping", + "package": "execution", + "tests": [] + }, … +] \ No newline at end of file