From 622e54523e930d0130fd4386edf0680d76990730 Mon Sep 17 00:00:00 2001 From: Pierre De Belen Date: Sat, 2 Nov 2024 18:07:06 -0400 Subject: [PATCH] FixCast --- .../ValueSpecificationDefaultVisitor.java | 44 +- .../autocomplete/handlers/FromHandler.java | 2 +- .../autocomplete/handlers/JoinHandler.java | 2 +- .../repl/dataCube/server/DataCubeHelpers.java | 2 +- .../dataCube/server/REPLServerHelpers.java | 2 +- .../server/handler/DataCubeQueryBuilder.java | 2 +- .../repl/dataCube/TestDataCubeHelpers.java | 10 +- .../ParameterizedValueSpecification.java | 44 +- ...tiveValueSpecificationToObjectVisitor.java | 44 +- .../TestParameterizedValueSpecification.java | 8 +- .../language/pure/compiler/api/Compile.java | 2 +- .../compiler/api/test/TestCompileApi.java | 10 +- .../language/pure/compiler/Compiler.java | 2 +- .../ClassMappingThirdPassBuilder.java | 2 +- .../compiler/toPureGraph/CompileContext.java | 75 ++- .../toPureGraph/HelperMappingBuilder.java | 40 +- .../toPureGraph/HelperModelBuilder.java | 24 +- .../HelperValueSpecificationBuilder.java | 14 +- .../compiler/toPureGraph/Milestoning.java | 62 +- .../toPureGraph/PropertyMappingBuilder.java | 7 +- .../pure/compiler/toPureGraph/PureModel.java | 2 +- .../toPureGraph/RelationTypeHelper.java | 4 +- .../ValueSpecificationBuilder.java | 51 +- .../ValueSpecificationBuilderForFuncExpr.java | 6 +- .../data/core/EmbeddedDataCompilerHelper.java | 2 +- .../toPureGraph/handlers/Handlers.java | 34 +- .../builder/FunctionExpressionBuilder.java | 4 +- .../handlers/inference/MostCommonType.java | 32 -- .../test/ModelStoreTestConnectionFactory.java | 2 +- .../test/TestCompilationFromGrammar.java | 2 +- .../api/test/TestGrammarToJsonApi.java | 2 +- .../from/antlr4/core/M3ParserGrammar.g4 | 12 +- .../pure/grammar/from/PureGrammarParser.java | 1 - .../ModelStoreDataParseTreeWalker.java | 14 +- .../from/domain/DateParseTreeWalker.java | 6 +- .../from/domain/DomainParseTreeWalker.java | 89 +-- .../domain/GraphFetchTreeParseTreeWalker.java | 12 +- .../domain/NavigationParseTreeWalker.java | 14 +- .../domain/StrictTimeParseTreeWalker.java | 2 +- .../DEPRECATED_PureGrammarComposerCore.java | 61 +- ...lperValueSpecificationGrammarComposer.java | 46 +- .../data/ModelStoreDataGrammarComposer.java | 44 +- .../test/parser/TestDomainGrammarParser.java | 41 ++ .../test/parser/TestMappingGrammarParser.java | 2 +- .../TestDomainGrammarArgumentsRoundtrip.java | 54 ++ .../pure/v1/model/type/GenericType.java | 44 ++ .../PackageableType.java} | 17 +- .../protocol/pure/v1/model/type/Type.java | 29 + .../model/{ => type}/relationType/Column.java | 15 +- .../{ => type}/relationType/RelationType.java | 17 +- .../ValueSpecification.java | 46 +- .../ValueSpecificationVisitor.java | 44 +- .../v1/model/valueSpecification/Variable.java | 2 +- .../AbstractAppliedFunction.java | 4 +- .../application/AppliedFunction.java | 1 - .../application/AppliedProperty.java | 1 - .../AppliedQualifiedProperty.java | 4 +- .../{raw => deprecated}/Class.java | 3 +- .../{raw => deprecated}/Enum.java | 3 +- .../{raw => deprecated}/HackedClass.java | 4 +- .../{raw => deprecated}/HackedUnit.java | 4 +- .../{raw => deprecated}/MappingInstance.java | 3 +- .../{raw => deprecated}/PrimitiveType.java | 3 +- .../UnknownAppliedFunction.java | 4 +- .../{raw => deprecated}/Whatever.java | 5 +- .../raw/GenericTypeInstance.java | 53 -- .../raw/{ => datatype}/CBoolean.java | 2 +- .../raw/{ => datatype}/CByteArray.java | 2 +- .../raw/{ => datatype}/CDate.java | 2 +- .../raw/{ => datatype}/CDateTime.java | 2 +- .../raw/{ => datatype}/CDecimal.java | 2 +- .../raw/{ => datatype}/CFloat.java | 2 +- .../raw/{ => datatype}/CInteger.java | 2 +- .../raw/{ => datatype}/CLatestDate.java | 2 +- .../raw/{ => datatype}/CStrictDate.java | 2 +- .../raw/{ => datatype}/CStrictTime.java | 2 +- .../raw/{ => datatype}/CString.java | 2 +- .../DataTypeValueSpecification.java | 4 +- .../raw/{ => datatype}/EnumValue.java | 2 +- .../PrimitiveValueSpecification.java | 3 +- .../raw/{ => datatype}/UnitInstance.java | 2 +- .../GenericTypeInstance.java | 84 +++ .../PackageableElementPtr.java | 3 +- .../test/TestCompatibilityAndMigration.java | 543 +++++++++++------- .../TestM2MGrammarCompileAndExecute.java | 2 +- .../assertion/TestTestAssertionEvaluator.java | 2 +- ...tiveValueSpecificationToObjectVisitor.java | 44 +- .../plugin/RelationalGraphFetchUtils.java | 16 +- .../MilestoningParseTreeWalker.java | 6 +- .../milestoning/BusinessMilestoning.java | 2 +- .../milestoning/ProcessingMilestoning.java | 2 +- .../valueSpecification/DatabaseInstance.java | 2 +- .../ValueSpecificationToResultVisitor.java | 44 +- .../TestValueSpecificationBuilder.java | 44 +- .../shared/utils/SQLProviderUtils.java | 4 +- 95 files changed, 1240 insertions(+), 834 deletions(-) create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/{valueSpecification/raw/DeprecatedValueSpecification.java => type/PackageableType.java} (56%) create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/{ => type}/relationType/Column.java (66%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/{ => type}/relationType/RelationType.java (62%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => application}/AbstractAppliedFunction.java (87%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{application => deprecated}/AppliedQualifiedProperty.java (95%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/Class.java (92%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/Enum.java (92%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/HackedClass.java (89%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/HackedUnit.java (90%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/MappingInstance.java (92%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/PrimitiveType.java (95%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{application => deprecated}/UnknownAppliedFunction.java (94%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/Whatever.java (88%) delete mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CBoolean.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CByteArray.java (97%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CDate.java (96%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CDateTime.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CDecimal.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CFloat.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CInteger.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CLatestDate.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CStrictDate.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CStrictTime.java (97%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CString.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/DataTypeValueSpecification.java (87%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/EnumValue.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/PrimitiveValueSpecification.java (95%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/UnitInstance.java (97%) create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => packageableElement}/PackageableElementPtr.java (94%) diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java index c3692b40e2e..2b47bf24d9e 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; public class ValueSpecificationDefaultVisitor implements ValueSpecificationVisitor { diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java index ad1e906ef6d..ae183f9131f 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java @@ -20,7 +20,7 @@ import org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.repl.autocomplete.Completer; import org.finos.legend.engine.repl.autocomplete.CompletionItem; import org.finos.legend.engine.repl.autocomplete.FunctionHandler; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java index 1c318f4bd11..2e97e974455 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.repl.autocomplete.Completer; import org.finos.legend.engine.repl.autocomplete.CompletionItem; import org.finos.legend.engine.repl.autocomplete.FunctionHandler; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java index 6c802da0fa4..052dfb05df6 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java @@ -36,7 +36,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.SingleExecutionPlan; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.pure.code.core.PureCoreExtensionLoader; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java index 78f0ec301cc..4081ee3deef 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java @@ -35,7 +35,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpec; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpecArray; import org.finos.legend.engine.repl.client.Client; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java index 94833b616a0..9debbe9347a 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.language.pure.grammar.to.PureGrammarComposerContext; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.repl.autocomplete.CompletionResult; import org.finos.legend.engine.repl.dataCube.server.DataCubeHelpers; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java index bc75b1db240..3f6088e1a67 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java @@ -240,7 +240,7 @@ private void testTypeahead(String expectedResult, String code, Lambda lambda, Pu public void testExtractRelationReturnTypeGroupBy() { String lambda = "|#>{test::TestDatabase.TEST0}#->filter(c | $c.FIRSTNAME != 'Doe')->groupBy(~[FIRSTNAME], ~[count: x | $x.FIRSTNAME : y | $y->count()])->from(test::test)"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"count\",\"type\":\"Integer\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"count\",\"type\":\"Integer\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -248,7 +248,7 @@ public void testExtractRelationReturnTypeGroupBy() public void testExtractRelationReturnTypeCast() { String lambda = "|#>{test::TestDatabase.TEST0}#->filter(c | $c.FIRSTNAME != 'Doe')->from(test::test)->groupBy(~[FIRSTNAME], ~[count: x | $x.FIRSTNAME : y | $y->count()])->cast(@meta::pure::metamodel::relation::Relation<(hai:String,ba:Integer)>)"; - String expectedResult = "{\"columns\":[{\"name\":\"hai\",\"type\":\"String\"},{\"name\":\"ba\",\"type\":\"Integer\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"hai\",\"type\":\"String\"},{\"name\":\"ba\",\"type\":\"Integer\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -256,7 +256,7 @@ public void testExtractRelationReturnTypeCast() public void testExtractRelationReturnTypeSimpleExtend() { String lambda = "|#>{test::TestDatabase.TEST0}#->extend(~newCol:c|'ok')"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -264,7 +264,7 @@ public void testExtractRelationReturnTypeSimpleExtend() public void testExtractRelationReturnTypeMultipleExtend() { String lambda = "|#>{test::TestDatabase.TEST0}#->extend(~[newCol:c|'ok', colX: c|$c.FIRSTNAME])"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -272,7 +272,7 @@ public void testExtractRelationReturnTypeMultipleExtend() public void testExtractRelationReturnTypeWithDummySource() { String lambda = "|''->cast(@meta::pure::metamodel::relation::Relation<(FIRSTNAME:String,LASTNAME:String)>)->extend(~[newCol:c|'ok', colX: c|$c.FIRSTNAME])"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; testExtractRelationReturnType(expectedResult, lambda, null); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java index 99513a373f7..4f91da4d189 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java @@ -21,33 +21,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import java.util.ArrayList; import java.util.HashMap; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java index f9696e0815d..237b75858af 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.PureList; import java.io.ByteArrayInputStream; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/test/java/org/finos/legend/engine/plan/execution/parameterization/TestParameterizedValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/test/java/org/finos/legend/engine/plan/execution/parameterization/TestParameterizedValueSpecification.java index 6ea7c758786..59a1ca22417 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/test/java/org/finos/legend/engine/plan/execution/parameterization/TestParameterizedValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/test/java/org/finos/legend/engine/plan/execution/parameterization/TestParameterizedValueSpecification.java @@ -21,10 +21,10 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.ParameterValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.shared.core.ObjectMapperFactory; import org.junit.Assert; import org.junit.Test; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java index 91add3ec413..452c3f598a1 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java @@ -28,7 +28,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContext; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextPointer; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.kerberos.ProfileManagerHelper; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java index 09b36ef8b99..72265e40723 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java @@ -17,19 +17,17 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import net.javacrumbs.jsonunit.JsonAssert; -import org.finos.legend.engine.language.pure.compiler.Compiler; import org.finos.legend.engine.language.pure.compiler.api.Compile; import org.finos.legend.engine.language.pure.compiler.api.LambdaReturnTypeInput; -import org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel; import org.finos.legend.engine.language.pure.grammar.from.PureGrammarParser; import org.finos.legend.engine.language.pure.modelManager.ModelManager; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextText; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.Column; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.shared.core.ObjectMapperFactory; import org.finos.legend.engine.shared.core.deployment.DeploymentMode; -import org.finos.legend.engine.shared.core.identity.Identity; import org.junit.Assert; import org.junit.Test; @@ -113,9 +111,9 @@ public void testRelationType() throws JsonProcessingException lambdaReturnTypeInput.model = text; lambdaReturnTypeInput.lambda = lambda; String stringResult = objectMapper.writeValueAsString(compileApi.lambdaRelationType(lambdaReturnTypeInput, null, null).getEntity()); - org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType relationType = objectMapper.readValue(stringResult, RelationType.class); + RelationType relationType = objectMapper.readValue(stringResult, RelationType.class); Assert.assertEquals(1, relationType.columns.size()); - org.finos.legend.engine.protocol.pure.v1.model.relationType.Column column = relationType.columns.get(0); + Column column = relationType.columns.get(0); Assert.assertEquals("Person Name", column.name); Assert.assertEquals("String", column.type); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java index 3dd7d648f7c..0d7d00c5f5d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java @@ -66,7 +66,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation return (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation.RelationType) type; } - public static org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType getLambdaRelationType(Lambda lambda, PureModel pureModel) + public static org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType getLambdaRelationType(Lambda lambda, PureModel pureModel) { return RelationTypeHelper.convert(buildLambdaRelationType(lambda, pureModel)); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java index df95ae27e62..77abf9c7e10 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java @@ -26,7 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.mapping.PureInstanceClassMapping; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.mapping.PurePropertyMapping; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.shared.core.operational.Assert; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.pure.generated.core_pure_router_operations_router_operations; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java index b42e890b265..cad8f04d02d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java @@ -22,6 +22,7 @@ import org.eclipse.collections.api.map.MutableMap; import org.eclipse.collections.api.set.ImmutableSet; import org.eclipse.collections.api.tuple.Pair; +import org.eclipse.collections.impl.utility.ListIterate; import org.finos.legend.engine.language.pure.compiler.toPureGraph.extension.CompilerExtensions; import org.finos.legend.engine.language.pure.compiler.toPureGraph.extension.Processor; import org.finos.legend.engine.language.pure.compiler.toPureGraph.handlers.builder.FunctionExpressionBuilder; @@ -33,6 +34,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TagPtr; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.section.ImportAwareCodeSection; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.section.Section; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.shared.core.deployment.DeploymentMode; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; @@ -47,6 +50,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValue; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.ConcreteFunctionDefinition; +import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enum; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enumeration; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Measure; @@ -57,7 +61,11 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification; import org.finos.legend.pure.m3.coreinstance.meta.pure.store.Store; import org.finos.legend.pure.m3.execution.ExecutionSupport; +import org.finos.legend.pure.m3.navigation.M3Paths; +import org.finos.legend.pure.m3.navigation.ProcessorSupport; import org.finos.legend.pure.m3.navigation._package._Package; +import org.finos.legend.pure.m3.navigation.relation._Column; +import org.finos.legend.pure.m3.navigation.relation._RelationType; import org.slf4j.Logger; import java.util.List; @@ -540,23 +548,80 @@ private MutableMap searchImports(String name, Function public GenericType newGenericType(Type rawType) { - return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(rawType); + return newGenericType(rawType, this.pureModel); } public GenericType newGenericType(Type rawType, GenericType typeArgument) { - return newGenericType(rawType, Lists.fixedSize.with(typeArgument)); + return newGenericType(rawType, this.pureModel)._typeArguments(Lists.fixedSize.with(typeArgument)); } public GenericType newGenericType(Type rawType, RichIterable typeArguments) { - return newGenericType(rawType)._typeArguments(typeArguments); + return newGenericType(rawType, this.pureModel)._typeArguments(typeArguments); + } + + public GenericType newGenericType(Type rawType, RichIterable typeArguments, RichIterable multiplicityArguments) + { + return newGenericType(rawType, this.pureModel)._typeArguments(typeArguments)._multiplicityArguments(multiplicityArguments); + } + + + public GenericType newGenericType(org.finos.legend.engine.protocol.pure.v1.model.type.GenericType genericType) + { + ProcessorSupport processorSupport = pureModel.getExecutionSupport().getProcessorSupport(); + GenericType gt = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType)); + SourceInformation si = null; + org.finos.legend.engine.protocol.pure.v1.model.type.Type protocolType = genericType.rawType; + Type type = null; + if (protocolType instanceof PackageableType) + { + si = ((PackageableType) protocolType).sourceInformation; + type = this.resolveType(((PackageableType) protocolType).fullPath, si); + } + else if (protocolType instanceof RelationType) + { + si = ((RelationType) protocolType).sourceInformation; + type = _RelationType.build( + ListIterate.collect(((RelationType) protocolType).columns, x -> _Column.getColumnInstance(x.name, false, x.type, (Multiplicity) org.finos.legend.pure.m3.navigation.multiplicity.Multiplicity.newMultiplicity(0, 1, processorSupport), null, processorSupport)), + SourceInformationHelper.toM3SourceInformation(si), + processorSupport + ); + } + else + { + throw new EngineException(genericType.rawType.getClass() + " is not supported yet!", genericType.sourceInformation, EngineErrorType.COMPILATION); + } + + return gt._rawType(type)._typeArguments(ListIterate.collect(genericType.typeArguments, this::newGenericType)); + } + + + public static GenericType newGenericType(Type rawType, PureModel pureModel) + { + return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType)) + ._rawType(rawType); + } + + public static GenericType newGenericType(Type rawType, GenericType typeArgument, PureModel pureModel) + { + return newGenericType(rawType, pureModel)._typeArguments(Lists.fixedSize.with(typeArgument)); } + public static GenericType newGenericType(Type rawType, RichIterable typeArguments, PureModel pureModel) + { + return newGenericType(rawType, pureModel)._typeArguments(typeArguments); + } + + public static GenericType newGenericType(Type rawType, RichIterable typeArguments, RichIterable multiplicityArguments, PureModel pureModel) + { + return newGenericType(rawType, pureModel)._typeArguments(typeArguments)._multiplicityArguments(multiplicityArguments); + } + + public TaggedValue newTaggedValue(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TaggedValue taggedValue) { - return new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue")) + return new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, this.pureModel.getClass(M3Paths.TaggedValue)) ._tag(resolveTag(taggedValue.tag)) ._value(taggedValue.value); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java index fd7c68ef5b9..69f59f5e0fa 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java @@ -72,6 +72,7 @@ import org.finos.legend.pure.generated.Root_meta_pure_metamodel_type_generics_GenericType_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl; import org.finos.legend.pure.generated.Root_meta_pure_test_AtomicTest; +import org.finos.legend.pure.m2.dsl.mapping.M2MappingPaths; import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.AssociationImplementation; import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.InstanceSetImplementation; import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping; @@ -93,6 +94,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.store.Store; import org.finos.legend.pure.m3.coreinstance.meta.pure.test.Test; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement; import java.util.List; @@ -155,7 +157,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Enumeratio // process enum value mappings String id = getEnumerationMappingId(em); return new Root_meta_pure_mapping_EnumerationMapping_Impl<>(id, SourceInformationHelper.toM3SourceInformation(em.sourceInformation), null) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::mapping::EnumerationMapping"))._typeArguments(Lists.mutable.with(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::type::Any"))))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M2MappingPaths.EnumerationMapping), Lists.mutable.with(context.newGenericType(context.pureModel.getType(M3Paths.Any))))) ._name(id) ._parent(pureMapping) ._enumeration(context.resolveEnumeration(em.enumeration.path, em.enumeration.sourceInformation)) @@ -287,13 +289,13 @@ public static String getClassMappingId(ClassMapping cm, CompileContext context) return cm.id != null ? cm.id : HelperModelBuilder.getElementFullPath(context.resolveClass(cm._class, cm.classSourceInformation), context.pureModel.getExecutionSupport()).replaceAll("::", "_"); } - public static LambdaFunction processPurePropertyMappingTransform(PurePropertyMapping ppm, Lambda lambda, PropertyMappingsImplementation owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type inputVarType, CompileContext context, String mappingName) + public static LambdaFunction processPurePropertyMappingTransform(PurePropertyMapping ppm, Lambda lambda, PropertyMappingsImplementation owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type inputVarType, CompileContext context, String mappingName) { List expressions = lambda.body; VariableExpression lambdaParam = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression")) ._name("src") ._multiplicity(context.pureModel.getMultiplicity("one")) - ._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(inputVarType)); + ._genericType(context.newGenericType(inputVarType)); MutableList pureParameters = Lists.mutable.with(lambdaParam); ProcessingContext ctx = new ProcessingContext("Pure M2M Transform Lambda"); ctx.addInferredVariables("src", lambdaParam); @@ -301,12 +303,11 @@ public static LambdaFunction processPurePropertyMappingTransform(PurePropertyMap MutableList valueSpecifications = ListIterate.collect(expressions, p -> p.accept(new ValueSpecificationBuilder(context, openVariables, ctx))); MutableList cleanedOpenVariables = openVariables.distinct(); cleanedOpenVariables.removeAll(pureParameters.collect(e -> e._name())); - GenericType functionType = context.pureModel.buildFunctionType(pureParameters, valueSpecifications.getLast()._genericType(), valueSpecifications.getLast()._multiplicity(), context.pureModel); + GenericType functionType = PureModel.buildFunctionType(pureParameters, valueSpecifications.getLast()._genericType(), valueSpecifications.getLast()._multiplicity(), context.pureModel); String propertyName = owner._id() + "." + ppm.property.property; - String mappingPath = Root_meta_pure_functions_meta_elementToPath_PackageableElement_1__String_1_(owner._parent(), context.pureModel.getExecutionSupport()).replace("::", "_"); ctx.flushVariable("src"); - return new Root_meta_pure_metamodel_function_LambdaFunction_Impl(propertyName, SourceInformationHelper.toM3SourceInformation(lambda.sourceInformation), null) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction"))._typeArguments(Lists.mutable.with(functionType))) + return new Root_meta_pure_metamodel_function_LambdaFunction_Impl(propertyName, SourceInformationHelper.toM3SourceInformation(lambda.sourceInformation), null) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), Lists.mutable.with(functionType))) ._openVariables(cleanedOpenVariables) ._expressionSequence(valueSpecifications); } @@ -452,13 +453,14 @@ public static Property getMappedProperty(PropertyMapping propertyMapping, Compil // Local property mapping LocalMappingPropertyInfo localMappingPropertyInfo = propertyMapping.localMappingProperty; - GenericType sourceGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")); // Raw type will be populated when mapping class is built - GenericType targetGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) + GenericType sourceGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType)); // Raw type will be populated when mapping class is built + GenericType targetGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType)) ._rawType(context.resolveType(localMappingPropertyInfo.type, localMappingPropertyInfo.sourceInformation)); - GenericType propertyClassifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property")) - ._typeArguments(Lists.fixedSize.of(sourceGenericType, targetGenericType)) - ._multiplicityArgumentsAdd(context.pureModel.getMultiplicity(localMappingPropertyInfo.multiplicity)); + GenericType propertyClassifierGenericType = context.newGenericType( + context.pureModel.getType(M3Paths.Property), + Lists.fixedSize.of(sourceGenericType, targetGenericType), + Lists.fixedSize.of(context.pureModel.getMultiplicity(localMappingPropertyInfo.multiplicity)) + ); return new Root_meta_pure_metamodel_function_property_Property_Impl<>(propertyMapping.property.property, SourceInformationHelper.toM3SourceInformation(propertyMapping.sourceInformation), null) ._name(propertyMapping.property.property) @@ -487,14 +489,14 @@ public static void buildMappingClassOutOfLocalProperties(SetImplementation setIm final MappingClass mappingClass = new Root_meta_pure_mapping_MappingClass_Impl<>(mappingClassName); mappingClass._name(mappingClassName); - - GenericType classifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::type::Class")) - ._typeArguments(Lists.fixedSize.of(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(mappingClass))); + GenericType classifierGenericType = context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::type::Class"), + Lists.fixedSize.of(context.newGenericType(mappingClass)) + ); mappingClass._classifierGenericType(classifierGenericType); - GenericType superType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(setImplementation._class()); - Generalization newGeneralization = new Root_meta_pure_metamodel_relationship_Generalization_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::relationship::Generalization"))._specific(mappingClass)._general(superType); + GenericType superType = context.newGenericType(setImplementation._class()); + Generalization newGeneralization = new Root_meta_pure_metamodel_relationship_Generalization_Impl("", null, context.pureModel.getClass(M3Paths.Generalization))._specific(mappingClass)._general(superType); mappingClass._generalizations(Lists.immutable.with(newGeneralization)); setImplementation._class()._specializationsAdd(newGeneralization); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java index 2168e347422..453ffb3217d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java @@ -87,7 +87,7 @@ public static org.eclipse.collections.api.block.function.Function(property.name, SourceInformationHelper.toM3SourceInformation(property.sourceInformation), context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) ._name(property.name) ._defaultValue(defaultValue) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property"))._typeArguments(Lists.fixedSize.of(genericType, returnGenericType))._multiplicityArgumentsAdd(context.pureModel.getMultiplicity(property.multiplicity))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.Property), Lists.fixedSize.of(genericType, returnGenericType), Lists.fixedSize.of(context.pureModel.getMultiplicity(property.multiplicity)))) ._genericType(returnGenericType) ._multiplicity(context.pureModel.getMultiplicity(property.multiplicity)) ._stereotypes(ListIterate.collect(property.stereotypes, s -> context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation))) @@ -136,7 +136,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespe public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification createVariableValueSpecification(CompileContext context, String variableName) { org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification ve = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name(variableName); - final GenericType genericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("Number")); + final GenericType genericType = context.newGenericType(context.pureModel.getType("Number")); ve._genericType(genericType); ve._multiplicity(context.pureModel.getMultiplicity(Multiplicity.PURE_ONE)); return ve; @@ -145,7 +145,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespe public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression createVariableForMapped(LambdaFunction mapFn, CompileContext context) { org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression ve = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name("mapped"); - final GenericType genericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(((Root_meta_pure_metamodel_type_FunctionType_Impl) mapFn._classifierGenericType()._typeArguments().getFirst()._rawType())._returnType._rawType()); + final GenericType genericType = context.newGenericType(((Root_meta_pure_metamodel_type_FunctionType_Impl) mapFn._classifierGenericType()._typeArguments().getFirst()._rawType())._returnType._rawType()); ve._genericType(genericType); Multiplicity multiplicity = new Multiplicity(); multiplicity.lowerBound = 0; @@ -172,8 +172,14 @@ public static org.eclipse.collections.api.block.function.Function context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation))) ._taggedValues(ListIterate.collect(property.taggedValues, t -> new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue"))._tag(context.resolveTag(t.tag.profile, t.tag.value, t.tag.profileSourceInformation, t.sourceInformation))._value(t.value))) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVariable).withAll(ListIterate.collect(property.parameters, p -> (VariableExpression) p.accept(new ValueSpecificationBuilder(context, Lists.mutable.empty(), processingContext)))), context.resolveGenericType(property.returnType, property.sourceInformation), context.pureModel.getMultiplicity(property.returnMultiplicity), context.pureModel)))) + ._classifierGenericType( + context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), + Lists.fixedSize.of( + PureModel.buildFunctionType(Lists.mutable.of(thisVariable).withAll(ListIterate.collect(property.parameters, p -> (VariableExpression) p.accept(new ValueSpecificationBuilder(context, Lists.mutable.empty(), processingContext)))), context.resolveGenericType(property.returnType, property.sourceInformation), context.pureModel.getMultiplicity(property.returnMultiplicity), context.pureModel) + ) + ) + ) ._owner(owner); }; } @@ -417,7 +423,7 @@ public static AbstractProperty getOwnedAppliedProperty(org.finos.legend.pure. public static AbstractProperty getAllOwnedAppliedProperty(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PropertyOwner propertyOwner, String name, org.finos.legend.engine.protocol.pure.v1.model.SourceInformation sourceInformation, CompiledExecutionSupport executionSupport) { AbstractProperty prop = null; - if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class) + if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class) { org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class _class = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class) propertyOwner; prop = _class._properties().detect(p -> name.equals(p.getName())); @@ -439,7 +445,7 @@ else if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pur org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Association _association = (Association) propertyOwner; prop = _association._properties().detect(p -> name.equals(p.getName())); } - String propertyOwnerType = propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class ? "class" : "association"; + String propertyOwnerType = propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class ? "class" : "association"; Assert.assertTrue(prop != null, () -> "Can't find property '" + name + "' in " + propertyOwnerType + " '" + (getElementFullPath(propertyOwner, executionSupport)) + "'", sourceInformation, EngineErrorType.COMPILATION); return prop; } @@ -452,7 +458,7 @@ else if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pur return getPropertyOrResolvedEdgePointProperty(context, _class, parameters, name, false, sourceInformation); } - public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property getPropertyOrResolvedEdgePointProperty(CompileContext context, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class _class, Optional> parameters, String name, boolean excludeQualified, org.finos.legend.engine.protocol.pure.v1.model.SourceInformation sourceInformation) + public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property getPropertyOrResolvedEdgePointProperty(CompileContext context, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class _class, Optional> parameters, String name, boolean excludeQualified, org.finos.legend.engine.protocol.pure.v1.model.SourceInformation sourceInformation) { AbstractProperty abstractProperty = HelperModelBuilder.getAppliedProperty(context, _class, parameters, name, excludeQualified, sourceInformation); if ((abstractProperty instanceof QualifiedProperty) && Milestoning.temporalStereotypes(((PackageableElement) abstractProperty._genericType()._rawType())._stereotypes()) != null) @@ -535,7 +541,7 @@ else if (excludeQualified) public static boolean isCompatibleDerivedPropertyWithParameters(QualifiedProperty o, List params) { - FunctionType rawType = (FunctionType) o._classifierGenericType()._typeArguments().getFirst()._rawType(); + FunctionType rawType = (FunctionType) o._classifierGenericType()._typeArguments().getFirst()._rawType(); return rawType._parameters().size() == params.size(); // && rawType._parameters().zip(params).allSatisfy(v1 -> v1.getOne()._name().equals(((Variable) v1.getTwo()).name)); // FIXME: we might need to be smarter about which property to choose (use types for example) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java index 2d6321a31a9..b8a581ab6b1 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java @@ -30,10 +30,10 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.SubTypeGraphFetchTree; @@ -45,7 +45,6 @@ import org.finos.legend.pure.generated.Root_meta_pure_graphFetch_RootGraphFetchTree_Impl; import org.finos.legend.pure.generated.Root_meta_pure_graphFetch_SubTypeGraphFetchTree_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_function_LambdaFunction_Impl; -import org.finos.legend.pure.generated.Root_meta_pure_metamodel_type_generics_GenericType_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_valuespecification_SimpleFunctionExpression_Impl; import org.finos.legend.pure.generated.Root_meta_pure_router_analytics_AnalyticsExecutionContext_Impl; @@ -68,6 +67,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpressionAccessor; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m3.navigation.relation._RelationType; import java.util.HashSet; @@ -134,7 +134,7 @@ public static LambdaFunction buildLambdaWithContext(String lambdaId, List(lambdaId) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction"))._typeArguments(FastList.newListWith(functionType))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), FastList.newListWith(functionType))) ._openVariables(cleanedOpenVariables) ._expressionSequence(valueSpecifications); @@ -423,9 +423,7 @@ private static GraphFetchTree buildRootGraphFetchTree(RootGraphFetchTree rootGra ListIterable children = ListIterate.collect(rootGraphFetchTree.subTrees, subTree -> buildGraphFetchTree(subTree, context, _class, openVariables, processingContext)); ListIterable subTypeTrees = ListIterate.collect(rootGraphFetchTree.subTypeTrees, subTypeTree -> buildSubTypeGraphFetchTree((SubTypeGraphFetchTree) subTypeTree, context, _class, openVariables, processingContext)); Class classifier = context.pureModel.getClass("meta::pure::graphFetch::RootGraphFetchTree"); - GenericType genericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(classifier) - ._typeArguments(Lists.fixedSize.of(context.pureModel.getGenericType(_class))); + GenericType genericType = context.newGenericType(classifier, Lists.fixedSize.of(context.pureModel.getGenericType(_class))); return new Root_meta_pure_graphFetch_RootGraphFetchTree_Impl<>("", SourceInformationHelper.toM3SourceInformation(rootGraphFetchTree.sourceInformation), classifier) ._class(_class) ._classifierGenericType(genericType) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java index 9f07df47e41..034ee753bb6 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java @@ -125,13 +125,10 @@ public static Iterable generateMilestoningProperties(Class generateMilestoningDateProperties(CompileContext context, MilestoningStereotype milestoningStereotype, Class owner) { GenericType dateGenericType = context.pureModel.getGenericType("Date"); - MutableList generatedMilestoningDateProperties = Lists.mutable.ofAll(milestoningStereotype.getTemporalDatePropertyNames()).collect(name -> new Root_meta_pure_metamodel_function_property_Property_Impl<>(name,null,context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) + MutableList generatedMilestoningDateProperties = Lists.mutable.ofAll(milestoningStereotype.getTemporalDatePropertyNames()).collect(name -> new Root_meta_pure_metamodel_function_property_Property_Impl<>(name, null, context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) ._name(name) ._genericType(dateGenericType) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property")) - ._typeArguments(Lists.fixedSize.of(owner._classifierGenericType(), dateGenericType)) - ._multiplicityArgumentsAdd(context.pureModel.getMultiplicity("zeroone"))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.Property), Lists.fixedSize.of(owner._classifierGenericType(), dateGenericType), Lists.fixedSize.of(context.pureModel.getMultiplicity("zeroone")))) ._multiplicity(context.pureModel.getMultiplicity("one")) ._stereotypes(Lists.fixedSize.of(generatedMilestoningStereotype(context, GeneratedMilestoningStereotype.generatedmilestoningdateproperty))) ._owner(owner)); @@ -141,13 +138,12 @@ private static MutableList generateMilestoningDateProperties(CompileCo private static Property generateMilestoningRangeProperty(CompileContext context, MilestoningStereotype milestoningStereotype, Class owner) { GenericType milestoningRangePropertyGenericType = context.resolveGenericType(milestoningStereotype.getMilestoningPropertyClassName()); - Property generatedMilestoningRangeProperty = new Root_meta_pure_metamodel_function_property_Property_Impl<>(MilestoningFunctions.MILESTONING,null,context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) + Property generatedMilestoningRangeProperty = new Root_meta_pure_metamodel_function_property_Property_Impl<>(MilestoningFunctions.MILESTONING, null, context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) ._name(MilestoningFunctions.MILESTONING) ._genericType(milestoningRangePropertyGenericType) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property")) - ._typeArguments(Lists.fixedSize.of(owner._classifierGenericType(), milestoningRangePropertyGenericType)) - ._multiplicityArgumentsAdd(context.pureModel.getMultiplicity("zeroone"))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.Property), + Lists.fixedSize.of(owner._classifierGenericType(), milestoningRangePropertyGenericType), + Lists.fixedSize.of(context.pureModel.getMultiplicity("zeroone")))) ._multiplicity(context.pureModel.getMultiplicity("zeroone")) ._stereotypes(Lists.fixedSize.of(generatedMilestoningStereotype(context, GeneratedMilestoningStereotype.generatedmilestoningdateproperty))) ._owner(owner); @@ -221,9 +217,9 @@ private static MilestoningPropertyTransformation milestoningPropertyTransformati private static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property edgePointProperty(PropertyOwner owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property originalProperty, MutableList stereotypes, CompileContext context) { String edgePointPropertyName = MilestoningFunctions.getEdgePointPropertyName(originalProperty._name()); - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity multiplicity = new Root_meta_pure_metamodel_multiplicity_Multiplicity_Impl("",null,context.pureModel.getType(M3Paths.Multiplicity)) + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity multiplicity = new Root_meta_pure_metamodel_multiplicity_Multiplicity_Impl("", null, context.pureModel.getType(M3Paths.Multiplicity)) ._lowerBound(originalProperty._multiplicity()._lowerBound()) - ._upperBound(new Root_meta_pure_metamodel_multiplicity_MultiplicityValue_Impl("",null,context.pureModel.getType(M3Paths.MultiplicityValue))._value(-1L)); + ._upperBound(new Root_meta_pure_metamodel_multiplicity_MultiplicityValue_Impl("", null, context.pureModel.getType(M3Paths.MultiplicityValue))._value(-1L)); return newProperty(owner, originalProperty, edgePointPropertyName, multiplicity, stereotypes, context); } @@ -264,10 +260,8 @@ private static QualifiedProperty newSingleDateMilestoningQualifiedPropertyNoA GenericType functionType = PureModel.buildFunctionType(Lists.fixedSize.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel); - LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::function::LambdaFunction")) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction")) - ._typeArguments(Lists.mutable.with(functionType))) + LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass(M3Paths.LambdaFunction)) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), Lists.mutable.with(functionType))) ._openVariables(Lists.fixedSize.of("this")) ._expressionSequence(Lists.fixedSize.of(equalExpression)); @@ -290,9 +284,10 @@ private static QualifiedProperty newSingleDateMilestoningQualifiedPropertyNoA ._multiplicity(context.pureModel.getMultiplicity("zeromany")) ._parametersValues(Lists.fixedSize.of(filterLhs, filterInstanceValue)); - GenericType classifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel))); + GenericType classifierGenericType = context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), + Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel)) + ); SimpleFunctionExpression finalExpression = filterExpression; if (originalProperty._multiplicity() == context.pureModel.getMultiplicity("one")) @@ -347,10 +342,8 @@ private static MutableList> newSingleDateMilestoningQualifi GenericType functionType = PureModel.buildFunctionType(Lists.fixedSize.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel); - LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::function::LambdaFunction")) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction")) - ._typeArguments(Lists.mutable.with(functionType))) + LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass(M3Paths.LambdaFunction)) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), Lists.mutable.with(functionType))) ._openVariables(returnTypeMilestoningStereotype.getTemporalDatePropertyNames()) ._expressionSequence(Lists.fixedSize.of(equalExpression)); @@ -384,9 +377,10 @@ private static MutableList> newSingleDateMilestoningQualifi ._parametersValues(Lists.fixedSize.of(filterExpression)); } - GenericType classifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar).withAll(datesToCompare.collect(Pair::getOne)), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel))); + GenericType classifierGenericType = context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), + Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar).withAll(datesToCompare.collect(Pair::getOne)), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel)) + ); qualifiedProperty._classifierGenericType(classifierGenericType); qualifiedProperty._expressionSequence(Lists.fixedSize.of(finalExpression)); @@ -438,9 +432,11 @@ private static MutableList> generateMilestoningRangeQualifi ._parametersValues(Lists.mutable.of(temporalDatePropertyExp, inputStartDate)); LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::function::LambdaFunction")) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction")) - ._typeArguments(Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel)))) + ._classifierGenericType( + context.newGenericType( + context.pureModel.getType(M3Paths.LambdaFunction), + Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel)) + )) ._openVariables(Lists.mutable.of(temporalDatePropertyName)) ._expressionSequence(Lists.mutable.of(equalExpression)); @@ -464,9 +460,7 @@ private static MutableList> generateMilestoningRangeQualifi ._parametersValues(Lists.mutable.of(filterLhs, filterInstanceValue)); QualifiedProperty milestoningRangeQualifiedProperty = getQualifiedProperty(propertyOwner, originalProperty, qualifiedPropertyName, originalProperty._multiplicity(), stereotypes) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar, inputStartDate, inputEndDate), originalProperty._genericType(), originalProperty._multiplicity(), context.pureModel)))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar, inputStartDate, inputEndDate), originalProperty._genericType(), originalProperty._multiplicity(), context.pureModel)))) ._expressionSequence(Lists.mutable.of(filterExpression)); generatedMilestoningRangeQualifiedProperty.add(milestoningRangeQualifiedProperty); @@ -476,7 +470,7 @@ private static MutableList> generateMilestoningRangeQualifi private static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property newProperty(PropertyOwner owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property originalProperty, String name, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity multiplicity, ListIterable stereotypes, CompileContext context) { - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property property = newAbstractProperty(owner, originalProperty, name, multiplicity, stereotypes, new Root_meta_pure_metamodel_function_property_Property_Impl(name,null,context.pureModel.getClass("meta::pure::metamodel::function::property::Property"))); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property property = newAbstractProperty(owner, originalProperty, name, multiplicity, stereotypes, new Root_meta_pure_metamodel_function_property_Property_Impl(name, null, context.pureModel.getClass("meta::pure::metamodel::function::property::Property"))); property._classifierGenericType(originalProperty._classifierGenericType()); return property; } @@ -510,7 +504,7 @@ private static Predicate isGeneratedMilestoningNonDateProperty() public static Boolean isGeneratedMilestoningQualifiedProperty(AbstractProperty p) { - return (p._stereotypes().anySatisfy(s -> s._value().equals(GeneratedMilestoningStereotype.generatedmilestoningproperty.name())) && (p instanceof QualifiedProperty)) ? true : false; + return (p._stereotypes().anySatisfy(s -> s._value().equals(GeneratedMilestoningStereotype.generatedmilestoningproperty.name())) && (p instanceof QualifiedProperty)) ? true : false; } public static Boolean isDateArgGeneratedMilestoningQualifiedProperty(AbstractProperty p) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java index ff8808a79a8..5843f045cfa 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java @@ -48,6 +48,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m4.coreinstance.SourceInformation; import java.util.function.Function; @@ -149,11 +150,11 @@ public PropertyMapping visit(XStorePropertyMapping propertyMapping) org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity oneMultiplicity = this.context.pureModel.getMultiplicity("one"); org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression thisVariable = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name("this"); - thisVariable._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(thisClass)); + thisVariable._genericType(context.newGenericType(thisClass)); thisVariable._multiplicity(oneMultiplicity); org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression thatVariable = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name("that"); - thatVariable._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(thatClass)); + thatVariable._genericType(context.newGenericType(thatClass)); thatVariable._multiplicity(oneMultiplicity); MutableList pureParameters = FastList.newListWith(thisVariable, thatVariable); @@ -176,7 +177,7 @@ public PropertyMapping visit(XStorePropertyMapping propertyMapping) } LambdaFunction lambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl(parent._id() + "." + propertyMapping.property.property, new SourceInformation(mappingPath, 0, 0, 0, 0), null) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction"))._typeArguments(FastList.newListWith(functionType))) + ._classifierGenericType(context.newGenericType(this.context.pureModel.getType(M3Paths.LambdaFunction), FastList.newListWith(functionType))) ._openVariables(cleanedOpenVariables) ._expressionSequence(valueSpecifications); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java index ca0bc746e7f..47432497aed 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java @@ -1181,7 +1181,7 @@ public GenericType getGenericType(String fullPath, SourceInformation sourceInfor public GenericType getGenericType(Type type) { - return this.typesGenericTypeIndex.getIfAbsentPut(buildTypeId(type), () -> new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(type)); + return this.typesGenericTypeIndex.getIfAbsentPut(buildTypeId(type), () -> CompileContext.newGenericType(type, this)); } public String buildTypeId(Type type) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java index e98fdb65e18..dd991e38224 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java @@ -15,8 +15,8 @@ package org.finos.legend.engine.language.pure.compiler.toPureGraph; import org.eclipse.collections.impl.utility.ListIterate; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.Column; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.Column; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType; import org.finos.legend.pure.m3.navigation.ProcessorSupport; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java index bcef782fe83..94671570ead 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java @@ -28,33 +28,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.AggregateValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.ExecutionContextInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.Pair; @@ -755,13 +755,8 @@ public ValueSpecification visit(MappingInstance mappingInstance) @Override public ValueSpecification visit(GenericTypeInstance genericTypeInstance) { - // Support casting to a relation - if (genericTypeInstance.typeArguments != null && !genericTypeInstance.typeArguments.isEmpty() && genericTypeInstance.typeArguments.get(0) instanceof ClassInstance && ((ClassInstance) genericTypeInstance.typeArguments.get(0)).type.equals("colSpecArray")) - { - return proccessColSpecArray((ColSpecArray) ((ClassInstance) genericTypeInstance.typeArguments.get(0)).value); - } return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", null, this.context.pureModel.getClass(M3Paths.InstanceValue)) - ._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType))._rawType(this.context.resolveType(genericTypeInstance.fullPath, genericTypeInstance.sourceInformation))) + ._genericType(context.newGenericType(genericTypeInstance.genericType)) ._multiplicity(this.context.pureModel.getMultiplicity("one")); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java index d42441339e3..6e158092d98 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java @@ -19,6 +19,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.pure.generated.Root_meta_core_runtime_Runtime; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_type_generics_GenericType_Impl; @@ -44,7 +45,7 @@ public ValueSpecificationBuilderForFuncExpr(CompileContext context, MutableList< } @Override - public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr packageableElementPtr) + public ValueSpecification visit(PackageableElementPtr packageableElementPtr) { if (packageableElementPtr.fullPath.contains("~")) { @@ -57,7 +58,8 @@ public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.v if (packageableElement instanceof Root_meta_pure_runtime_PackageableRuntime) { Root_meta_core_runtime_Runtime resolvedRuntime = this.context.resolveRuntime(packageableElementPtr.fullPath); - GenericType runtimeGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType))._rawType(this.context.pureModel.getType("meta::core::runtime::Runtime")); + GenericType runtimeGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType)) + ._rawType(this.context.pureModel.getType("meta::core::runtime::Runtime")); return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", SourceInformationHelper.toM3SourceInformation(packageableElementPtr.sourceInformation), this.context.pureModel.getClass(M3Paths.InstanceValue)) ._genericType(runtimeGenericType) ._multiplicity(this.context.pureModel.getMultiplicity("one")) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java index ab1e0cf303a..a5540cb5203 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java @@ -26,7 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.data.*; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.pure.generated.*; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java index e71d0b2684a..16802a4556d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java @@ -966,20 +966,13 @@ public Handlers(PureModel pureModel) ); // Inference in the context of the parent - register(m(m(h("meta::pure::tds::agg_String_1__FunctionDefinition_1__FunctionDefinition_1__AggregateValue_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::tds::AggregateValue")) - ._typeArguments(Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2)))), - "one"), ps -> Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2))), ps -> ps.size() == 3 && typeOne(ps.get(0), "String"))), + register(m(m(h("meta::pure::tds::agg_String_1__FunctionDefinition_1__FunctionDefinition_1__AggregateValue_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::tds::AggregateValue"), Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2))), this.pureModel), "one"), ps -> Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2))), ps -> ps.size() == 3 && typeOne(ps.get(0), "String"))), m(h("meta::pure::functions::collection::agg_FunctionDefinition_1__FunctionDefinition_1__AggregateValue_1_", false, ps -> res("meta::pure::functions::collection::AggregateValue", "one"), ps -> true)))); - register(m(m(h("meta::pure::tds::col_Function_1__String_1__String_1__BasicColumnSpecification_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification")) - ._typeArguments(Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType())), + register(m(m(h("meta::pure::tds::col_Function_1__String_1__String_1__BasicColumnSpecification_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification"), Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), pureModel), "one"), ps -> Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), ps -> ps.size() == 3)), - m(h("meta::pure::tds::col_Function_1__String_1__BasicColumnSpecification_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification")) - ._typeArguments(Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType())), + m(h("meta::pure::tds::col_Function_1__String_1__BasicColumnSpecification_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification"), Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), pureModel), "one"), ps -> Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), ps -> true)))); // ---------------------------- @@ -1046,9 +1039,7 @@ public Handlers(PureModel pureModel) ) ); - register("meta::pure::functions::collection::pair_U_1__V_1__Pair_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::functions::collection::Pair")) - ._typeArguments(Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList()))), "one")); + register("meta::pure::functions::collection::pair_U_1__V_1__Pair_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::functions::collection::Pair"), Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList())), this.pureModel), "one")); register(h("meta::pure::functions::multiplicity::toOne_T_MANY__T_1_", true, ps -> res(ps.get(0)._genericType(), "one"), ps -> Lists.mutable.with(ps.get(0)._genericType()), ps -> true)); @@ -1185,13 +1176,13 @@ public Handlers(PureModel pureModel) ); register("meta::pure::executionPlan::featureFlag::withFeatureFlags_T_MANY__Enum_MANY__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany")); register(m( - m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.pureModel.getType("meta::pure::dataQuality::Checked"))._typeArgumentsAdd(ps.get(0)._genericType()), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 2)), - m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Integer_1__Checked_MANY_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.pureModel.getType("meta::pure::dataQuality::Checked"))._typeArgumentsAdd(ps.get(0)._genericType()), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 3)) + m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::dataQuality::Checked"), ps.get(0)._genericType(), this.pureModel), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 2)), + m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Integer_1__Checked_MANY_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::dataQuality::Checked"), ps.get(0)._genericType(), pureModel), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 3)) ) ); register("meta::pure::graphFetch::execution::graphFetchUnexpanded_T_MANY__RootGraphFetchTree_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany")); - register("meta::pure::graphFetch::execution::graphFetchCheckedUnexpanded_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.pureModel.getType("meta::pure::dataQuality::Checked"))._typeArgumentsAdd(ps.get(0)._genericType()), "zeroMany")); + register("meta::pure::graphFetch::execution::graphFetchCheckedUnexpanded_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::dataQuality::Checked"), ps.get(0)._genericType(), pureModel), "zeroMany")); register(m( m(h("meta::pure::graphFetch::execution::serialize_Checked_MANY__RootGraphFetchTree_1__String_1_", false, ps -> res("String", "one"), ps -> ps.size() == 2 && "Checked".equals(ps.get(0)._genericType()._rawType()._name()))), m(h("meta::pure::graphFetch::execution::serialize_T_MANY__RootGraphFetchTree_1__String_1_", false, ps -> res("String", "one"), ps -> ps.size() == 2)), @@ -1211,9 +1202,7 @@ public Handlers(PureModel pureModel) register(m(m(h("meta::pure::functions::collection::dropAt_T_MANY__Integer_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany"), ps -> ps.size() == 2)), m(h("meta::pure::functions::collection::dropAt_T_MANY__Integer_1__Integer_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany"), ps -> ps.size() == 3)))); - register("meta::pure::functions::collection::zip_T_MANY__U_MANY__Pair_MANY_", true, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::functions::collection::Pair")) - ._typeArguments(Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList()))), "oneMany")); + register("meta::pure::functions::collection::zip_T_MANY__U_MANY__Pair_MANY_", true, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::functions::collection::Pair"), Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList())), pureModel), "oneMany")); register(m(grp(LambdaInference, h("meta::pure::functions::collection::removeDuplicatesBy_T_MANY__Function_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany"), p -> true)))); register("meta::pure::functions::collection::containsAll_Any_MANY__Any_MANY__Boolean_1_", false, ps -> res("Boolean", "one")); @@ -1812,12 +1801,7 @@ private void registerAlgebra() private void registerOlapMath() { - ReturnInference resolve = ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::functions::collection::Map")) - ._typeArguments(FastList.newListWith( - this.pureModel.getGenericType("meta::pure::metamodel::type::Any"), - this.pureModel.getGenericType("Integer") - )), "one"); + ReturnInference resolve = ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::functions::collection::Map"), FastList.newListWith(this.pureModel.getGenericType("meta::pure::metamodel::type::Any"), this.pureModel.getGenericType("Integer")), pureModel), "one"); register(m( m(h("meta::pure::functions::math::olap::rank_Any_MANY__Map_1_", false, resolve)), diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java index 79a409f209a..56b89b150b9 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java @@ -24,11 +24,11 @@ import org.finos.legend.engine.language.pure.compiler.toPureGraph.handlers.FunctionHandler; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java index 5ab85398da0..5e7df44909c 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java @@ -22,38 +22,6 @@ public class MostCommonType { public static GenericType mostCommon(MutableList sourceTypes, PureModel pureModel) { - // Need generics return (GenericType) org.finos.legend.pure.m3.navigation.generictype.GenericType.findBestCommonGenericType(sourceTypes.collect(s -> s), true, false, pureModel.getExecutionSupport().getProcessorSupport()); -// Type nil = pureModel.getType(M3Paths.Nil); -// MutableList types = sourceTypes.select(t->!t.equals(nil)); -// if (types.isEmpty()) -// { -// return pureModel.getGenericType(M3Paths.Nil); -// } -// else -// { -// Type res = types.size() == 1? types.get(0):types.take(types.size()-1).injectInto(types.get(types.size()-1), (a,b) -> mostCommon(a,b, pureModel)); -// return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(res); -// } } - - -// public static Type mostCommon(Type a, Type b, PureModel pureModel) -// { -// if (a == b) -// { -// return a; -// } -// ListIterable la = C3Linearization.getTypeGeneralizationLinearization(a, pureModel.getExecutionSupport().getProcessorSupport()).toReversed(); -// ListIterable lb = C3Linearization.getTypeGeneralizationLinearization(b, pureModel.getExecutionSupport().getProcessorSupport()).toReversed(); -// int min = Math.min(la.size(), lb.size()); -// for (int i=0; i < min; i++) -// { -// if (la.get(i) != lb.get(i)) -// { -// return (Type)la.get(i-1); -// } -// } -// return (Type)la.get(min-1); -// } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java index 8449f408ef6..86dd6c4442a 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java @@ -26,7 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.connection.JsonModelConnection; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.connection.XmlModelConnection; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.url.InputStreamProvider; import org.finos.legend.engine.shared.core.url.StreamProviderHolder; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java index aa3a2355e47..2433ef207be 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java @@ -1090,7 +1090,7 @@ public void testRelation() " city : x|$x.city,\n" + " treePlanted: x|$x.treePlanted,\n" + " year: x|$x.year\n" + - " ])->pivot(~[country, city], ~[total: x|$x.treePlanted : x|$x->sum()])->cast(@Relation<(year2:Integer)>)->filter(x|$x.year2 == 2000)\n" + + " ])->pivot(~[country, city], ~[total: x|$x.treePlanted : x|$x->sum()])->cast(@meta::pure::metamodel::relation::Relation<(year2:Integer)>)->filter(x|$x.year2 == 2000)\n" + "}" ); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java index fcce3fc4a39..0b06a5d8036 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java @@ -138,7 +138,7 @@ private String getJsonString(String path) public void testLambdaWithCast() { test("{\"isolatedLambdas\":{\"testLambda\":\"src:OldClass[1]|$src->cast(@newClass)\"}}", - "{\"isolatedLambdas\":{\"lambdas\":{\"testLambda\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"cast\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":17,\"startLine\":1}},{\"_type\":\"genericTypeInstance\",\"fullPath\":\"newClass\",\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":29,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":23,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"OldClass\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":15,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + "{\"isolatedLambdas\":{\"lambdas\":{\"testLambda\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"cast\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":17,\"startLine\":1}},{\"_type\":\"genericTypeInstance\",\"genericType\":{\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"newClass\",\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":29,\"startLine\":1}},\"typeArguments\":[],\"typeVariables\":[]},\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":28,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":23,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"OldClass\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":15,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); } private void test(String request, String expected) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 index 74735dd367e..6fd30ed965b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 @@ -211,14 +211,22 @@ type: (qualifiedName (LESS_THAN typeAr | ( PAREN_OPEN - columnType (COMMA columnType)* + columnInfo (COMMA columnInfo)* PAREN_CLOSE ) | unitName ; -columnType: identifier COLON identifier + +columnInfo: columnName COLON columnType +; + +columnName: identifier ; + +columnType: identifier +; + functionTypePureType: type multiplicity ; typeAndMultiplicityParameters: LESS_THAN ((typeParameters multiplictyParameters?) | multiplictyParameters) GREATER_THAN diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java index c1142928244..01025cf72ab 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java @@ -38,7 +38,6 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; import org.finos.legend.engine.shared.core.identity.Identity; -import org.finos.legend.engine.shared.core.identity.factory.*; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.engine.shared.core.operational.logs.LogInfo; import org.finos.legend.engine.shared.core.operational.logs.LoggingEventType; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java index 03575109246..c5e775d0516 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java @@ -29,15 +29,15 @@ import org.finos.legend.engine.protocol.pure.v1.model.data.ModelInstanceTestData; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import java.math.BigDecimal; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java index 98c1139e03f..dc3113a7fac 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java @@ -17,9 +17,9 @@ import org.antlr.v4.runtime.tree.TerminalNode; import org.finos.legend.engine.language.pure.grammar.from.ParseTreeWalkerSourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; public class DateParseTreeWalker diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java index 0159ad1dcb3..29ffbd74ce8 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java @@ -72,22 +72,27 @@ import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.EqualTo; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.EqualToJson; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.TestAssertion; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.type.Type; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.Column; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpec; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpecArray; @@ -290,7 +295,11 @@ private EnumValue visitEnumValue(DomainParserGrammar.EnumValueContext ctx) private Class visitClass(DomainParserGrammar.ClassDefinitionContext ctx) { - // TODO: break if use of generics! + if (ctx.typeParametersWithContravarianceAndMultiplicityParameters() != null && !ctx.typeParametersWithContravarianceAndMultiplicityParameters().isEmpty()) + { + throw new EngineException("Type and/or multiplicity parameters are not authorized in Legend Engine", walkerSourceInformation.getSourceInformation(ctx.typeParametersWithContravarianceAndMultiplicityParameters()), EngineErrorType.PARSER); + } + Class _class = new Class(); _class._package = ctx.qualifiedName().packagePath() == null ? "" : PureGrammarParserUtility.fromPath(ctx.qualifiedName().packagePath().identifier()); _class.name = PureGrammarParserUtility.fromIdentifier(ctx.qualifiedName().identifier()); @@ -426,6 +435,11 @@ private Association visitAssociation(DomainParserGrammar.AssociationContext ctx) private org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function visitFunction(DomainParserGrammar.FunctionDefinitionContext ctx) { + if (ctx.typeAndMultiplicityParameters() != null && !ctx.typeAndMultiplicityParameters().isEmpty()) + { + throw new EngineException("Type and/or multiplicity parameters are not authorized in Legend Engine", walkerSourceInformation.getSourceInformation(ctx.typeAndMultiplicityParameters()), EngineErrorType.PARSER); + } + org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function func = new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function(); func._package = ctx.qualifiedName().packagePath() == null ? "" : PureGrammarParserUtility.fromPath(ctx.qualifiedName().packagePath().identifier()); func.stereotypes = ctx.stereotypes() == null ? Lists.mutable.empty() : this.visitStereotypes(ctx.stereotypes()); @@ -740,8 +754,8 @@ private List codeBlock(DomainParserGrammar.CodeBlockContext private ValueSpecification programLine(DomainParserGrammar.ProgramLineContext ctx, List typeParametersNames, LambdaContext lambdaContext, boolean addLines, String space) { return (ctx.combinedExpression() == null) ? - letExpression(ctx.letExpression(), typeParametersNames, lambdaContext, addLines, space) : - combinedExpression(ctx.combinedExpression(), "line", typeParametersNames, lambdaContext, space, true, addLines); + letExpression(ctx.letExpression(), typeParametersNames, lambdaContext, addLines, space) : + combinedExpression(ctx.combinedExpression(), "line", typeParametersNames, lambdaContext, space, true, addLines); } public ValueSpecification combinedExpression(DomainParserGrammar.CombinedExpressionContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) @@ -834,7 +848,7 @@ private CByteArray byteArray(DomainParserGrammar.ToBytesLiteralContext ctx) private ValueSpecification enumReference(DomainParserGrammar.EnumReferenceContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) { - org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue result = new org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue(); + org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue result = new org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue(); result.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); result.fullPath = PureGrammarParserUtility.fromQualifiedName(ctx.qualifiedName().packagePath() == null ? Collections.emptyList() : ctx.qualifiedName().packagePath().identifier(), ctx.qualifiedName().identifier()); result.value = PureGrammarParserUtility.fromIdentifier(ctx.identifier()); @@ -1261,11 +1275,10 @@ private ValueSpecification atomicExpression(DomainParserGrammar.AtomicExpression { return unitTypeReference(ctx.type()); } - if (ctx.type().typeArguments() != null && !ctx.type().typeArguments().type().get(0).columnType().isEmpty()) - { - return processRelationColumnTypes(ctx.type()); - } - return typeReference(ctx.type()); + GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); + genericTypeInstance.genericType = processGenericType(ctx.type()); + genericTypeInstance.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); + return genericTypeInstance; } if (ctx.anyLambda() != null) { @@ -1519,7 +1532,7 @@ private GenericTypeInstance typeReference(DomainParserGrammar.TypeContext ctx) { String fullPath = ctx.getText(); GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); - genericTypeInstance.fullPath = fullPath; + genericTypeInstance.genericType = new GenericType(new PackageableType(fullPath)); genericTypeInstance.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); return genericTypeInstance; } @@ -1528,33 +1541,35 @@ private GenericTypeInstance unitTypeReference(DomainParserGrammar.TypeContext ct { String fullPath = ctx.unitName().qualifiedName().getText().concat(TILDE).concat(ctx.unitName().identifier().getText()); GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); - genericTypeInstance.fullPath = fullPath; + genericTypeInstance.genericType = new GenericType(new PackageableType(fullPath)); genericTypeInstance.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); return genericTypeInstance; } - private GenericTypeInstance processRelationColumnTypes(DomainParserGrammar.TypeContext ctx) + private GenericType processGenericType(DomainParserGrammar.TypeContext ctx) { - String fullPath = ctx.qualifiedName().getText(); - GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); - genericTypeInstance.fullPath = fullPath; - genericTypeInstance.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); - if (!"meta::pure::metamodel::relation::Relation".equals(fullPath) && !"Relation".equals(fullPath)) + Type type; + if (ctx.qualifiedName() != null) { - throw new EngineException("Casting to type with generics is only supported for Relation type", walkerSourceInformation.getSourceInformation(ctx), EngineErrorType.PARSER); + PackageableType pType = new PackageableType(ctx.qualifiedName().getText()); + pType.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); + type = pType; } - List columnTypeContexts = ctx.typeArguments().type().get(0).columnType(); - ColSpecArray colSpecArr = new ColSpecArray(); - colSpecArr.colSpecs = ListIterate.collect(columnTypeContexts, columnTypeContext -> + else if (ctx.PAREN_OPEN() != null) { - ColSpec colSpec = new ColSpec(); - colSpec.sourceInformation = walkerSourceInformation.getSourceInformation(columnTypeContext); - colSpec.name = PureGrammarParserUtility.fromIdentifier(columnTypeContext.identifier().get(0)); - colSpec.type = PureGrammarParserUtility.fromIdentifier(columnTypeContext.identifier().get(1)); - return colSpec; - }); - genericTypeInstance.typeArguments = Lists.mutable.with(DomainParseTreeWalker.wrapWithClassInstance(colSpecArr, walkerSourceInformation.getSourceInformation(ctx), "colSpecArray")); - return genericTypeInstance; + type = new RelationType(ListIterate.collect(ctx.columnInfo(), x -> + { + Column column = new Column(x.columnName().getText(), x.columnType().getText()); + column.sourceInformation = walkerSourceInformation.getSourceInformation(x); + return column; + })); + } + else + { + throw new EngineException("The type " + ctx.getText() + " is not supported yet", this.walkerSourceInformation.getSourceInformation(ctx), EngineErrorType.PARSER); + } + + return new GenericType(type, ListIterate.collect(ctx.typeArguments() == null ? Lists.mutable.empty() : ctx.typeArguments().type(), this::processGenericType)); } private ValueSpecification allOrFunction(DomainParserGrammar.AllOrFunctionContext ctx, ValueSpecification instance, DomainParserGrammar.QualifiedNameContext funcName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean addLines) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java index eb59afff0dc..00d86864548 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java @@ -20,14 +20,14 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.GraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java index 78966c86aa7..ecaf49f703b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java @@ -21,14 +21,14 @@ import org.finos.legend.engine.language.pure.grammar.from.antlr4.navigation.NavigationParserGrammar; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.Path; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.PropertyPathElement; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java index 6a383c19658..e33f03d4362 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java @@ -17,7 +17,7 @@ import org.antlr.v4.runtime.tree.TerminalNode; import org.finos.legend.engine.language.pure.grammar.from.ParseTreeWalkerSourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; public class StrictTimeParseTreeWalker diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java index fa02df963c8..21dcdec8175 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java @@ -61,32 +61,32 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.AggregateValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.PureList; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.TDSAggregateValue; @@ -648,7 +648,7 @@ public String visit(ValueSpecification valueSpecification) } @Override - public String visit(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class _class) + public String visit(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class _class) { return HelperValueSpecificationGrammarComposer.printFullPath(_class.fullPath, this); } @@ -1039,22 +1039,7 @@ public String visit(AppliedQualifiedProperty appliedQualifiedProperty) public String visit(GenericTypeInstance genericTypeInstance) { StringBuilder builder = new StringBuilder(); - builder.append('@' + HelperValueSpecificationGrammarComposer.printFullPath(genericTypeInstance.fullPath, this)); - if (genericTypeInstance.typeArguments != null && !genericTypeInstance.typeArguments.isEmpty() && genericTypeInstance.typeArguments.get(0) instanceof ClassInstance && ((ClassInstance) genericTypeInstance.typeArguments.get(0)).type.equals("colSpecArray")) - { - ColSpecArray colSpecArray = (ColSpecArray) ((ClassInstance) genericTypeInstance.typeArguments.get(0)).value; - builder.append("<("); - if (this.isRenderingPretty()) - { - builder.append(this.returnChar() + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, getTabSize(1)) + " "); - } - builder.append(LazyIterate.collect(colSpecArray.colSpecs, colSpec -> HelperValueSpecificationGrammarComposer.printColSpec(colSpec, this)).makeString("," + (this.isRenderingPretty() ? this.returnChar() + " " + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, getTabSize(1)) : " "))); - if (this.isRenderingPretty()) - { - builder.append(this.returnChar() + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, 0)).append(" "); - } - builder.append(")>"); - } + builder.append('@' + printGenericType(genericTypeInstance.genericType)); return builder.toString(); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java index a455acfefa7..373a7a60211 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java @@ -23,18 +23,22 @@ import org.finos.legend.engine.language.pure.grammar.from.domain.DateParseTreeWalker; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.type.Type; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.PathElement; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.PropertyPathElement; @@ -93,7 +97,7 @@ public static boolean isPrimitiveValue(ValueSpecification valueSpecification) public static String printColSpec(ColSpec col, DEPRECATED_PureGrammarComposerCore transformer) { - return PureGrammarComposerUtility.convertIdentifier(col.name) + (col.type != null ? ":" + col.type : "") + (col.function1 != null ? ":" + (transformer.isRenderingPretty() ? " " : "") + col.function1.accept(transformer) : "") + (col.function2 != null ? ":" + col.function2.accept(transformer) : ""); + return PureGrammarComposerUtility.convertIdentifier(col.name) + (col.type != null ? ":" + col.type : "") + (col.function1 != null ? ":" + (transformer.isRenderingPretty() ? " " : "") + col.function1.accept(transformer) : "") + (col.function2 != null ? ":" + col.function2.accept(transformer) : ""); } public static String printColSpecArray(ColSpecArray colSpecArray, DEPRECATED_PureGrammarComposerCore transformer) @@ -360,4 +364,26 @@ public static String generateValidDateValueContainingPercent(String date) { return date.indexOf(DateParseTreeWalker.DATE_PREFIX) != -1 ? date : DateParseTreeWalker.DATE_PREFIX + date; } + + public static String printGenericType(GenericType genericType) + { + return printType(genericType.rawType) + + (genericType.typeArguments.isEmpty() ? + "" : + "<" + ListIterate.collect(genericType.typeArguments, HelperValueSpecificationGrammarComposer::printGenericType).makeString(", ") + ">" + ); + } + + public static String printType(Type type) + { + if (type instanceof PackageableType) + { + return ((PackageableType) type).fullPath; + } + else if (type instanceof RelationType) + { + return "(" + ListIterate.collect(((RelationType) type).columns, x -> x.name + ":" + x.type).makeString(", ") + ")"; + } + throw new RuntimeException(type.getClass().getSimpleName() + ": Not supported"); + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java index accf4123e49..2ae0fa5dcd3 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java @@ -26,33 +26,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import java.util.List; import java.util.Stack; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java index 5a9df1e107a..92a509e449b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java @@ -26,6 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Class; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Profile; +import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.junit.Assert; import org.junit.Test; @@ -162,4 +163,44 @@ public void testProfile() Assert.assertEquals(18, profile.tags.get(1).sourceInformation.startColumn); Assert.assertEquals(21, profile.tags.get(1).sourceInformation.endColumn); } + + @Test + public void testPreventTypeParametersInClass() + { + EngineException e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X{}")); + Assert.assertEquals("PARSER error at [1:11-13]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X<|m>{}")); + Assert.assertEquals("PARSER error at [1:11-14]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X{}")); + Assert.assertEquals("PARSER error at [1:11-15]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X{}")); + Assert.assertEquals("PARSER error at [1:11-19]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + } + + @Test + public void testPreventTypeParametersInFunction() + { + EngineException e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-16]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f<|m>(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-17]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-18]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-22]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java index 0a1b2e4e170..3b74a45b637 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java @@ -31,7 +31,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.Mapping; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; import org.finos.legend.engine.shared.core.operational.Assert; import org.junit.Test; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java new file mode 100644 index 00000000000..f73f05fc55b --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java @@ -0,0 +1,54 @@ +// Copyright 2024 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.language.pure.grammar.test.roundtrip; + +import org.finos.legend.engine.language.pure.grammar.test.TestGrammarRoundtrip; +import org.junit.Test; + +public class TestDomainGrammarArgumentsRoundtrip extends TestGrammarRoundtrip.TestGrammarRoundtripTestSuite +{ + // TO FIX ------ + // We don't want to authorize typeParameters but typeArguments for system's parameterized types should be allowed + // Unfortunately the parser is considering Result as a type and not a GenericType with rawType=Result and typeArguments = GenericType(rawType=String) + // Which means the compiler can't work... We need to parse the GenericType and 'slot' it in the Protocol. + // ------------- + + @Test + public void testFunctionWithTypeArguments() + { + test("function withPath::f(s: Result[1]): Result[0..1]\n" + + "{\n" + + " []\n" + + "}\n"); + } + + @Test + public void testClassPropertiesWithTypeArguments() + { + test("Class my::Class\n" + + "{\n" + + " prop1: Result[1];\n" + + "}\n"); + } + + @Test + public void testCast() + { + test("function withPath::f(s: a::Result[1]): Relation<(a:Integer)>[0..1]\n" + + "{\n" + + " []->cast(@Relation<(a:Integer)>)\n" + + "}\n"); + } +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java new file mode 100644 index 00000000000..0dff6869781 --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java @@ -0,0 +1,44 @@ +// Copyright 2024 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.protocol.pure.v1.model.type; + +import org.eclipse.collections.api.factory.Lists; +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; + +import java.util.List; + +public class GenericType +{ + public Type rawType; + public List typeArguments = Lists.mutable.empty(); + public List typeVariables = Lists.mutable.empty(); + public SourceInformation sourceInformation; + + public GenericType() + { + } + + public GenericType(Type rawType) + { + this.rawType = rawType; + } + + public GenericType(Type rawType, List typeArguments) + { + this.rawType = rawType; + this.typeArguments = typeArguments; + } +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DeprecatedValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/PackageableType.java similarity index 56% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DeprecatedValueSpecification.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/PackageableType.java index 435a48083d0..0bcf4e3935d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DeprecatedValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/PackageableType.java @@ -1,4 +1,4 @@ -// Copyright 2022 Goldman Sachs +// Copyright 2024 Goldman Sachs // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,8 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.type; -public abstract class DeprecatedValueSpecification extends One +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; + +public class PackageableType extends PackageableElementPtr implements Type { + public PackageableType() + { + super(); + } + + public PackageableType(String fullPath) + { + super(fullPath); + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java new file mode 100644 index 00000000000..d2ef15ff427 --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java @@ -0,0 +1,29 @@ +// Copyright 2024 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.protocol.pure.v1.model.type; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type") +@JsonSubTypes({ + // Collection + @JsonSubTypes.Type(value = PackageableType.class, name = "packageableType"), + @JsonSubTypes.Type(value = RelationType.class, name = "relationType"), +}) +public interface Type +{ +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/Column.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/Column.java similarity index 66% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/Column.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/Column.java index 6fade57c389..e3e2bc652cd 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/Column.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/Column.java @@ -12,10 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.relationType; +package org.finos.legend.engine.protocol.pure.v1.model.type.relationType; + +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; public class Column { + public SourceInformation sourceInformation; public String name; public String type; + + public Column() + { + } + + public Column(String name, String type) + { + this.name = name; + this.type = type; + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/RelationType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/RelationType.java similarity index 62% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/RelationType.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/RelationType.java index 51745fadb93..e3725e29af7 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/RelationType.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/RelationType.java @@ -12,12 +12,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.relationType; +package org.finos.legend.engine.protocol.pure.v1.model.type.relationType; + +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.type.Type; import java.util.Collections; import java.util.List; -public class RelationType +public class RelationType implements Type { + public SourceInformation sourceInformation; public List columns = Collections.emptyList(); + + public RelationType() + { + } + + public RelationType(List columns) + { + this.columns = columns; + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java index 39d857170ef..0f8ca6cc236 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java @@ -20,34 +20,34 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedClass; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedClass; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type") @JsonSubTypes({ diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java index 1893c48718d..32282c5b26b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java @@ -16,33 +16,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; public interface ValueSpecificationVisitor { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java index 2927df1c8ed..b0c9d2e63b4 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java @@ -19,7 +19,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; public class Variable extends ValueSpecification { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/AbstractAppliedFunction.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AbstractAppliedFunction.java similarity index 87% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/AbstractAppliedFunction.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AbstractAppliedFunction.java index 0827d5016d4..2fc847c3668 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/AbstractAppliedFunction.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AbstractAppliedFunction.java @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; + +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; public abstract class AbstractAppliedFunction extends One { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java index 67201910a36..8036dd5a0ed 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java @@ -16,7 +16,6 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; import java.util.Collections; import java.util.List; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java index 951ead3f86b..8eb7dcfd0a4 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; import java.util.Collections; import java.util.List; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedQualifiedProperty.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/AppliedQualifiedProperty.java similarity index 95% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedQualifiedProperty.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/AppliedQualifiedProperty.java index 8f991084762..7c949cecde3 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedQualifiedProperty.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/AppliedQualifiedProperty.java @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AbstractAppliedFunction; import java.util.Collections; import java.util.List; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Class.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Class.java similarity index 92% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Class.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Class.java index 7b75cec065e..f44ec582066 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Class.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Class.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Enum.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Enum.java similarity index 92% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Enum.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Enum.java index b20d1b288ce..9b8a6cb2889 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Enum.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Enum.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedClass.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedClass.java similarity index 89% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedClass.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedClass.java index 9d6030e1fd6..720a8d789e7 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedClass.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedClass.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -22,6 +22,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedUnit.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedUnit.java similarity index 90% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedUnit.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedUnit.java index 49f8ac7db57..bbd831de302 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedUnit.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedUnit.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -22,6 +22,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/MappingInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/MappingInstance.java similarity index 92% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/MappingInstance.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/MappingInstance.java index c6c2f34dd9a..f2bd0639b79 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/MappingInstance.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/MappingInstance.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/PrimitiveType.java similarity index 95% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveType.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/PrimitiveType.java index 85cca2fac1c..e0bbdb75e47 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveType.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/PrimitiveType.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -24,6 +24,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/UnknownAppliedFunction.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/UnknownAppliedFunction.java similarity index 94% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/UnknownAppliedFunction.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/UnknownAppliedFunction.java index 11f80d0da67..1706e436750 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/UnknownAppliedFunction.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/UnknownAppliedFunction.java @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AbstractAppliedFunction; @Deprecated public class UnknownAppliedFunction extends AbstractAppliedFunction diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Whatever.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Whatever.java similarity index 88% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Whatever.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Whatever.java index 3c241e5e104..ce59be2e8dc 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Whatever.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Whatever.java @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; @Deprecated -public class Whatever extends DeprecatedValueSpecification +public class Whatever extends One { @JsonProperty(value = "class") public String _class; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java deleted file mode 100644 index 67f9fff226f..00000000000 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; - -import java.io.IOException; -import java.util.List; - -public class GenericTypeInstance extends PackageableElementPtr -{ - public List typeArguments; - - public GenericTypeInstance() - { - } - - public GenericTypeInstance(String fullPath) - { - super(fullPath); - } - - @Override - public T accept(ValueSpecificationVisitor visitor) - { - return visitor.visit(this); - } - - public static class HackedClassDeserializer extends JsonDeserializer - { - @Override - public ValueSpecification deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException - { - return convert(jsonParser.getCodec().readTree(jsonParser)); - } - } -} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CBoolean.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CBoolean.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CBoolean.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CBoolean.java index fd6ccef22ce..7354afded50 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CBoolean.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CBoolean.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CByteArray.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CByteArray.java similarity index 97% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CByteArray.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CByteArray.java index 0d1fbff0c56..54912c9adcf 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CByteArray.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CByteArray.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDate.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDate.java similarity index 96% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDate.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDate.java index 11a41519bc3..4ab24edb0d5 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDate.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDate.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; public abstract class CDate extends PrimitiveValueSpecification { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDateTime.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDateTime.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDateTime.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDateTime.java index b0e3d5ae784..2537af20838 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDateTime.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDateTime.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDecimal.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDecimal.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDecimal.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDecimal.java index 6011ead401d..d4c5377b2ca 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDecimal.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDecimal.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CFloat.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CFloat.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CFloat.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CFloat.java index 3498dd57b63..4eba4d0b6ab 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CFloat.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CFloat.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CInteger.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CInteger.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CInteger.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CInteger.java index 9143b7c3360..9fcfb6340d7 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CInteger.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CInteger.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CLatestDate.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CLatestDate.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CLatestDate.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CLatestDate.java index 0b1d83e2c12..0e4cc8b6b48 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CLatestDate.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CLatestDate.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictDate.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictDate.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictDate.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictDate.java index f9cbbd99b90..c5baae3c709 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictDate.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictDate.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictTime.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictTime.java similarity index 97% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictTime.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictTime.java index 02b964a0226..839ba04ab72 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictTime.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictTime.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CString.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CString.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CString.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CString.java index 1493173488f..6a83ecb8ef9 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CString.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CString.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DataTypeValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/DataTypeValueSpecification.java similarity index 87% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DataTypeValueSpecification.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/DataTypeValueSpecification.java index d801d42f368..109d964487e 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DataTypeValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/DataTypeValueSpecification.java @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; + +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; public abstract class DataTypeValueSpecification extends One { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/EnumValue.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/EnumValue.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/EnumValue.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/EnumValue.java index 873df562c26..c8af037e0e1 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/EnumValue.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/EnumValue.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/PrimitiveValueSpecification.java similarity index 95% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveValueSpecification.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/PrimitiveValueSpecification.java index 48cd861dc8e..7d757868e59 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/PrimitiveValueSpecification.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -22,6 +22,7 @@ import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; import java.util.function.Function; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/UnitInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/UnitInstance.java similarity index 97% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/UnitInstance.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/UnitInstance.java index 0a8cc2e92ba..0eb70931d51 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/UnitInstance.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/UnitInstance.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java new file mode 100644 index 00000000000..66e3f361864 --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java @@ -0,0 +1,84 @@ +// Copyright 2020 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; + +import java.io.IOException; + +@JsonDeserialize(using = GenericTypeInstance.GenericTypeInstanceDeserializer.class) +public class GenericTypeInstance extends One +{ + protected static ObjectMapper om = PureProtocolObjectMapperFactory.getNewObjectMapper(); + + public GenericType genericType; + + public GenericTypeInstance() + { + } + + public GenericTypeInstance(GenericType genericType) + { + this.genericType = genericType; + } + + public GenericTypeInstance(String packageableType) + { + this.genericType = new GenericType(new PackageableType(packageableType)); + } + + @Override + public T accept(ValueSpecificationVisitor visitor) + { + return visitor.visit(this); + } + + public static class GenericTypeInstanceDeserializer extends JsonDeserializer + { + @Override + public ValueSpecification deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException + { + JsonNode node = jsonParser.getCodec().readTree(jsonParser); + JsonNode values = node.get("fullPath"); + ValueSpecification result; + if (values != null) + { + result = new GenericTypeInstance(new GenericType(new PackageableType(values.asText()))); + } + else + { + result = new GenericTypeInstance(om.treeToValue(node.get("genericType"), GenericType.class)); + } + JsonNode sourceInformation = node.get("sourceInformation"); + if (sourceInformation != null) + { + result.sourceInformation = om.treeToValue(sourceInformation, SourceInformation.class); + } + return result; + } + } +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PackageableElementPtr.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/PackageableElementPtr.java similarity index 94% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PackageableElementPtr.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/PackageableElementPtr.java index 34f3fd4af29..481ab8a82aa 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PackageableElementPtr.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/PackageableElementPtr.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -20,6 +20,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java index 54d9c2c4592..e8f89f932f1 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java @@ -334,200 +334,226 @@ public void testUnitType() throws Exception public void testCastType() throws Exception { check("{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"function\",\n" + - " \"body\": [\n" + - " {\n" + - " \"_type\": \"func\",\n" + - " \"function\": \"cast\",\n" + - " \"parameters\": [\n" + - " {\n" + - " \"_type\": \"packageableElementPtr\",\n" + - " \"fullPath\": \"a\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 2,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 2,\n" + - " \"startLine\": 1\n" + - " }\n" + - " },\n" + - " {\n" + - " \"_type\": \"hackedClass\",\n" + - " \"fullPath\": \"Type\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 7,\n" + - " \"endLine\": 2,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 4,\n" + - " \"startLine\": 2\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 8,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 5,\n" + - " \"startLine\": 1\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"name\": \"a\",\n" + - " \"package\": \"a\",\n" + - " \"parameters\": [],\n" + - " \"returnMultiplicity\": {\n" + - " \"lowerBound\": 0\n" + - " },\n" + - " \"returnType\": \"Any\"\n" + - " }\n" + - " ]\n" + - "}", "{\n" + - " \"_type\" : \"data\",\n" + - " \"elements\" : [ {\n" + - " \"_type\" : \"function\",\n" + - " \"name\" : \"a\",\n" + - " \"returnType\" : \"Any\",\n" + - " \"returnMultiplicity\" : {\n" + - " \"lowerBound\" : 0\n" + - " },\n" + - " \"body\" : [ {\n" + - " \"_type\" : \"func\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 5,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 8\n" + - " },\n" + - " \"function\" : \"cast\",\n" + - " \"parameters\" : [ {\n" + - " \"_type\" : \"packageableElementPtr\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 2,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 2\n" + - " },\n" + - " \"fullPath\" : \"a\"\n" + - " }, {\n" + - " \"_type\" : \"genericTypeInstance\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 2,\n" + - " \"startColumn\" : 4,\n" + - " \"endLine\" : 2,\n" + - " \"endColumn\" : 7\n" + - " },\n" + - " \"fullPath\" : \"Type\"\n" + - " } ]\n" + - " } ],\n" + - " \"package\" : \"a\"\n" + - " } ]\n" + - "}"); + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"packageableElementPtr\",\n" + + " \"fullPath\": \"a\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 2,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 2,\n" + + " \"startLine\": 1\n" + + " }\n" + + " },\n" + + " {\n" + + " \"_type\": \"hackedClass\",\n" + + " \"fullPath\": \"Type\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 7,\n" + + " \"endLine\": 2,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 4,\n" + + " \"startLine\": 2\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 8,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 5,\n" + + " \"startLine\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"name\": \"a\",\n" + + " \"package\": \"a\",\n" + + " \"parameters\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0\n" + + " },\n" + + " \"returnType\": \"Any\"\n" + + " }\n" + + " ]\n" + + "}", + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"name\": \"a\",\n" + + " \"returnType\": \"Any\",\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0\n" + + " },\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"sourceInformation\": {\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startLine\": 1,\n" + + " \"startColumn\": 5,\n" + + " \"endLine\": 1,\n" + + " \"endColumn\": 8\n" + + " },\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"packageableElementPtr\",\n" + + " \"sourceInformation\": {\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startLine\": 1,\n" + + " \"startColumn\": 2,\n" + + " \"endLine\": 1,\n" + + " \"endColumn\": 2\n" + + " },\n" + + " \"fullPath\": \"a\"\n" + + " },\n" + + " {\n" + + " \"_type\": \"genericTypeInstance\",\n" + + " \"sourceInformation\": {\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startLine\": 2,\n" + + " \"startColumn\": 4,\n" + + " \"endLine\": 2,\n" + + " \"endColumn\": 7\n" + + " },\n" + + " \"genericType\": {\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Type\"\n" + + " }\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"package\": \"a\"\n" + + " }\n" + + " ]\n" + + "}"); } @Test public void testCastUnit() throws Exception { check("{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"function\",\n" + - " \"body\": [\n" + - " {\n" + - " \"_type\": \"func\",\n" + - " \"function\": \"cast\",\n" + - " \"parameters\": [\n" + - " {\n" + - " \"_type\": \"packageableElementPtr\",\n" + - " \"fullPath\": \"a\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 2,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 2,\n" + - " \"startLine\": 1\n" + - " }\n" + - " },\n" + - " {\n" + - " \"_type\": \"hackedUnit\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 9,\n" + - " \"endLine\": 2,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 4,\n" + - " \"startLine\": 2\n" + - " },\n" + - " \"unitType\": \"Type~A\"\n" + - " }\n" + - " ],\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 8,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 5,\n" + - " \"startLine\": 1\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"name\": \"a\",\n" + - " \"package\": \"a\",\n" + - " \"parameters\": [],\n" + - " \"returnMultiplicity\": {\n" + - " \"lowerBound\": 0\n" + - " },\n" + - " \"returnType\": \"Any\"\n" + - " }\n" + - " ]\n" + - "}", "{\n" + - " \"_type\" : \"data\",\n" + - " \"elements\" : [ {\n" + - " \"_type\" : \"function\",\n" + - " \"name\" : \"a\",\n" + - " \"returnType\" : \"Any\",\n" + - " \"returnMultiplicity\" : {\n" + - " \"lowerBound\" : 0\n" + - " },\n" + - " \"body\" : [ {\n" + - " \"_type\" : \"func\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 5,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 8\n" + - " },\n" + - " \"function\" : \"cast\",\n" + - " \"parameters\" : [ {\n" + - " \"_type\" : \"packageableElementPtr\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 2,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 2\n" + - " },\n" + - " \"fullPath\" : \"a\"\n" + - " }, {\n" + - " \"_type\" : \"genericTypeInstance\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 2,\n" + - " \"startColumn\" : 4,\n" + - " \"endLine\" : 2,\n" + - " \"endColumn\" : 9\n" + - " },\n" + - " \"fullPath\" : \"Type~A\"\n" + - " } ]\n" + - " } ],\n" + - " \"package\" : \"a\"\n" + - " } ]\n" + - "}"); + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"packageableElementPtr\",\n" + + " \"fullPath\": \"a\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 2,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 2,\n" + + " \"startLine\": 1\n" + + " }\n" + + " },\n" + + " {\n" + + " \"_type\": \"hackedUnit\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 9,\n" + + " \"endLine\": 2,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 4,\n" + + " \"startLine\": 2\n" + + " },\n" + + " \"unitType\": \"Type~A\"\n" + + " }\n" + + " ],\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 8,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 5,\n" + + " \"startLine\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"name\": \"a\",\n" + + " \"package\": \"a\",\n" + + " \"parameters\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0\n" + + " },\n" + + " \"returnType\": \"Any\"\n" + + " }\n" + + " ]\n" + + "}", + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"name\": \"a\",\n" + + " \"returnType\": \"Any\",\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0\n" + + " },\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"sourceInformation\": {\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startLine\": 1,\n" + + " \"startColumn\": 5,\n" + + " \"endLine\": 1,\n" + + " \"endColumn\": 8\n" + + " },\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"packageableElementPtr\",\n" + + " \"sourceInformation\": {\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startLine\": 1,\n" + + " \"startColumn\": 2,\n" + + " \"endLine\": 1,\n" + + " \"endColumn\": 2\n" + + " },\n" + + " \"fullPath\": \"a\"\n" + + " },\n" + + " {\n" + + " \"_type\": \"genericTypeInstance\",\n" + + " \"sourceInformation\": {\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startLine\": 2,\n" + + " \"startColumn\": 4,\n" + + " \"endLine\": 2,\n" + + " \"endColumn\": 9\n" + + " },\n" + + " \"genericType\": {\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Type~A\"\n" + + " }\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"package\": \"a\"\n" + + " }\n" + + " ]\n" + + "}"); } @Test @@ -1231,33 +1257,118 @@ public void testDataElementReference() throws Exception { check( "{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"dataElement\",\n" + - " \"data\": {\n" + - " \"_type\": \"reference\",\n" + - " \"dataElement\": \"com::path::exampleReference\"\n" + - " },\n" + - " \"name\": \"dataElementReferenceExample\",\n" + - " \"package\": \"my\"\n" + - " }\n" + - " ]\n" + - "}\n", - "{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"dataElement\",\n" + - " \"data\": {\n" + - " \"_type\": \"reference\",\n" + - " \"dataElement\":{\"path\":\"com::path::exampleReference\",\"type\":\"DATA\"}" + - " },\n" + - " \"name\": \"dataElementReferenceExample\",\n" + - " \"package\": \"my\"\n" + - " }\n" + - " ]\n" + - "}\n"); + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"dataElement\",\n" + + " \"data\": {\n" + + " \"_type\": \"reference\",\n" + + " \"dataElement\": \"com::path::exampleReference\"\n" + + " },\n" + + " \"name\": \"dataElementReferenceExample\",\n" + + " \"package\": \"my\"\n" + + " }\n" + + " ]\n" + + "}\n", + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"dataElement\",\n" + + " \"data\": {\n" + + " \"_type\": \"reference\",\n" + + " \"dataElement\":{\"path\":\"com::path::exampleReference\",\"type\":\"DATA\"}" + + " },\n" + + " \"name\": \"dataElementReferenceExample\",\n" + + " \"package\": \"my\"\n" + + " }\n" + + " ]\n" + + "}\n"); + } + + @Test + public void testGenericTypeInstance() throws Exception + { + check( + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 0\n" + + " },\n" + + " \"values\": []\n" + + " },\n" + + " {\n" + + " \"_type\": \"genericTypeInstance\",\n" + + " \"fullPath\": \"String\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"name\": \"f__String_$0_1$_\",\n" + + " \"package\": \"withPath\",\n" + + " \"parameters\": [],\n" + + " \"postConstraints\": [],\n" + + " \"preConstraints\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"returnType\": \"String\",\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": []\n" + + " }\n" + + " ]\n" + + "}\n", + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"name\": \"f__String_$0_1$_\",\n" + + " \"returnType\": \"String\",\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 0\n" + + " }\n" + + " },\n" + + " {\n" + + " \"_type\": \"genericTypeInstance\",\n" + + " \"genericType\": {\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"String\"\n" + + " }\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"package\": \"withPath\"\n" + + " }\n" + + " ]\n" + + "}"); } @Test @@ -1266,7 +1377,7 @@ public void testStoreTestData() throws Exception check( new Scanner(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("simpleFunctionBefore.json"), "Can't find resource '" + "simpleFunctionBefore.json" + "'"), "UTF-8").useDelimiter("\\A").next(), new Scanner(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("simpleFunctionAfter.json"), "Can't find resource '" + "simpleFunctionAfter.json" + "'"), "UTF-8").useDelimiter("\\A").next() - ); + ); } @Test diff --git a/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java b/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java index 873b9653697..c46e70cf6cc 100644 --- a/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java +++ b/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java @@ -31,7 +31,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.executionContext.BaseExecutionContext; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; diff --git a/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java b/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java index db4744effa4..02b7ee3bc9e 100644 --- a/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java +++ b/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.status.AssertPass; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.status.AssertionStatus; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.status.EqualToJsonAssertFail; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; import org.junit.Assert; import org.junit.Test; diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java index cbf27dfd015..a7821d8d442 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import java.io.ByteArrayInputStream; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java index a9d9f59498b..820ac22db96 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java @@ -19,15 +19,15 @@ import org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCacheByEqualityKeys; import org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCacheKey; import org.finos.legend.engine.plan.execution.stores.relational.result.SQLExecutionResult; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.GraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.shared.core.collectionsExtensions.DoubleHashingStrategy; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java index aaad614fe76..eabe389a60f 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java @@ -23,9 +23,9 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning.BusinessSnapshotMilestoning; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning.Milestoning; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning.ProcessingMilestoning; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import java.util.regex.Matcher; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java index cb9624ddae4..7d87f57d73b 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java @@ -14,7 +14,7 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; public class BusinessMilestoning extends Milestoning { diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java index 87ad6f67f00..62002dcf646 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java @@ -14,7 +14,7 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; public class ProcessingMilestoning extends Milestoning { diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java index 0ad749039fc..c234bb055b8 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java index 86051e02ac3..b0c47d9b8ad 100644 --- a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java +++ b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.PureList; public class ValueSpecificationToResultVisitor implements ValueSpecificationVisitor diff --git a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java index 9c8017bc1d6..1c19fb101e8 100644 --- a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java +++ b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java @@ -29,33 +29,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.RuntimeInstance; import java.io.Closeable; diff --git a/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java b/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java index 7c95523c763..2c020a988a2 100644 --- a/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java +++ b/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java @@ -27,9 +27,9 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.runtime.IdentifiedConnection; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.runtime.StoreConnections; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.util.Collections; import java.util.List;