Skip to content

Commit

Permalink
Update model joins
Browse files Browse the repository at this point in the history
  • Loading branch information
haroonsherjan committed Mar 14, 2024
1 parent 7ab0939 commit dbe5565
Showing 1 changed file with 14 additions and 52 deletions.
66 changes: 14 additions & 52 deletions showcases/data/End To End Examples/Integrate Mappings/code.pure
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Mapping com::entity::LegalEntityMapping

Mapping com::trade::TradeWithLegalEntityMapping
(
include dataspace com::entity::EntityDataspace
include dataspace com::entity::EntityDataSpace

com::trade::Trade[trade]: Relational
{
Expand All @@ -87,7 +87,7 @@ Mapping com::trade::TradeWithLegalEntityMapping


###DataSpace
DataSpace com::entity::EntityDataspace
DataSpace com::entity::EntityDataSpace
{
executionContexts:
[
Expand All @@ -96,10 +96,10 @@ DataSpace com::entity::EntityDataspace
mapping: com::entity::LegalEntityMapping;
defaultRuntime: com::entity::EntityRuntime;
testData:
Reference
#{
com::entity::EntityData
}#;
Reference
#{
com::entity::EntityData
}#;
}
];
defaultExecutionContext: 'default';
Expand Down Expand Up @@ -173,13 +173,13 @@ SingleConnectionRuntime com::trade::AlternativeTradeRuntime
###Data
Data com::entity::EntityData
{
Relational
#{
Entity.LegalEntity:
'ENTITY_ID,name\n'+
'abc,Entity1\n'+
'def,Entity2\n';
}#
Relational
#{
Entity.LegalEntity:
'ENTITY_ID,name\n'+
'abc,Entity1\n'+
'def,Entity2\n';
}#
}


Expand Down Expand Up @@ -228,7 +228,7 @@ Service com::trade::ServiceSimpleProject
com::trade::TradeConnection:
DataspaceTestData
#{
com::entity::EntityDataspace;
com::entity::EntityDataSpace
}#
]
]
Expand All @@ -254,42 +254,4 @@ Service com::trade::ServiceSimpleProject
]
}
]
}


###Pure
function com::trade::TestFunction(): meta::pure::tds::TabularDataSet[1]
{
com::trade::Trade.all()->project(
[
x: com::trade::Trade[1]|$x.value,
x: com::trade::Trade[1]|$x.client.name
],
[
'Value',
'Client/Name'
]
)->from(
com::trade::TradeWithLegalEntityMapping,
com::trade::AlternativeTradeRuntime
)
}
{
testSuite_1
(
(dataspace) com::entity::EntityDataspace:
DataspaceTestData
#{
com::entity::EntityDataspace;
}#;
com::trade::TradeDatabase:
Relational
#{
Trade.Trade:
'id,value,ENTITY_ID_FK\n'+
'1,100,abc\n'+
'2,200,def\n';
}#;
test_1 | TestFunction() => (JSON) '[ {"Value" : 100,"Client/Name" : "EntityName1"}, {"Value" : 200,"Client/Name" : "EntityName2"} ]';
)
}

0 comments on commit dbe5565

Please sign in to comment.