Skip to content

Commit 6045c00

Browse files
committed
Updated and tested examples for upgrades related to #9.
1 parent 43cd482 commit 6045c00

27 files changed

+504
-275
lines changed

ClassLibrary/DataWarehouseAutomation/DataWarehouseAutomation/DataItemMapping.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ namespace DataWarehouseAutomation
99
public class DataItemMapping
1010
{
1111
[JsonProperty]
12-
public DataItem sourceDataItem { get; set; }
13-
14-
[JsonProperty("sourceDataQuery", NullValueHandling = NullValueHandling.Ignore)]
15-
public DataQuery sourceDataQuery { get; set; }
12+
public List<DataItem> sourceDataItems { get; set; }
1613

1714
[JsonProperty]
1815
public DataItem targetDataItem { get; set; }

ClassLibrary/DataWarehouseAutomation/Test_Project/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ static void Main(string[] args)
1212

1313
List<string> fileList = new List<string>();
1414
fileList.Add(AppDomain.CurrentDomain.BaseDirectory + @"..\..\SampleFiles\sampleBasic.json"); // Most basic test
15+
fileList.Add(AppDomain.CurrentDomain.BaseDirectory + @"..\..\SampleFiles\sampleBasicWithExtensions.json");
16+
fileList.Add(AppDomain.CurrentDomain.BaseDirectory + @"..\..\SampleFiles\sampleMultipleDataItemMappings.json");
1517
fileList.Add(AppDomain.CurrentDomain.BaseDirectory + @"..\..\SampleFiles\sampleSourceQuery.json"); // Simple test using a query as source
1618
fileList.Add(AppDomain.CurrentDomain.BaseDirectory + @"..\..\SampleFiles\sampleCalculation.json"); // Simple test using one of the column mappings as calculation
1719
fileList.Add(AppDomain.CurrentDomain.BaseDirectory + @"..\..\SampleFiles\sampleSimpleDDL.json"); // Simple test using one of the column mappings as calculation

ClassLibrary/DataWarehouseAutomation/Test_Project/SampleFiles/sampleBasic.json

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dataObjectMappings": [
33
{
44
"mappingName": "MappingOne",
5-
"sourceDataObject": [
5+
"sourceDataObjects": [
66
{
77
"name": "TableOneSource"
88
},
@@ -13,19 +13,23 @@
1313
"targetDataObject": {
1414
"name": "TableOneTarget"
1515
},
16-
"dataItemMapping": [
16+
"dataItemMappings": [
1717
{
18-
"sourceDataItem": {
19-
"name": "ColumnOneSource"
20-
},
18+
"sourceDataItems": [
19+
{
20+
"name": "ColumnOneSource"
21+
}
22+
],
2123
"targetDataItem": {
2224
"name": "ColumnOneTarget"
2325
}
2426
},
2527
{
26-
"sourceDataItem": {
27-
"name": "ColumnTwoSource"
28-
},
28+
"sourceDataItems": [
29+
{
30+
"name": "ColumnTwoSource"
31+
}
32+
],
2933
"targetDataItem": {
3034
"name": "ColumnTwoTarget"
3135
}
@@ -34,27 +38,31 @@
3438
},
3539
{
3640
"mappingName": "MappingTwo",
37-
"sourceDataObject": [
41+
"sourceDataObjects": [
3842
{
3943
"name": "TableTwoSource"
4044
}
4145
],
4246
"targetDataObject": {
4347
"name": "TableTwoTarget"
4448
},
45-
"dataItemMapping": [
49+
"dataItemMappings": [
4650
{
47-
"sourceDataItem": {
48-
"name": "ColumnOneSource"
49-
},
51+
"sourceDataItems": [
52+
{
53+
"name": "ColumnOneSource"
54+
}
55+
],
5056
"targetDataItem": {
5157
"name": "ColumnOneTarget"
5258
}
5359
},
5460
{
55-
"sourceDataItem": {
56-
"name": "ColumnTwoSource"
57-
},
61+
"sourceDataItems": [
62+
{
63+
"name": "ColumnTwoSource"
64+
}
65+
],
5866
"targetDataItem": {
5967
"name": "ColumnTwoTarget"
6068
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"dataObjectMappings": [
3+
{
4+
"mappingName": "MappingOne",
5+
"sourceDataObjects": [
6+
{
7+
"name": "TableOneSource"
8+
}
9+
],
10+
"targetDataObject": {
11+
"name": "TableOneTarget",
12+
"extensions": [
13+
{
14+
"key": "colour",
15+
"value": "green",
16+
"description": "The colour of the object."
17+
},
18+
{
19+
"key": "taste",
20+
"value": "questionable",
21+
"description": "The taste of the object."
22+
}
23+
]
24+
},
25+
"dataItemMappings": [
26+
{
27+
"sourceDataItems": [
28+
{
29+
"name": "ColumnOneSource"
30+
}
31+
],
32+
"targetDataItem": {
33+
"name": "ColumnOneTarget"
34+
}
35+
},
36+
{
37+
"sourceDataItems": [
38+
{
39+
"name": "ColumnTwoSource"
40+
}
41+
],
42+
"targetDataItem": {
43+
"name": "ColumnTwoTarget"
44+
}
45+
}
46+
]
47+
}
48+
]
49+
}

ClassLibrary/DataWarehouseAutomation/Test_Project/SampleFiles/sampleCalculation.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,31 @@
22
"dataObjectMappings": [
33
{
44
"mappingName": "Mapping1",
5-
"sourceDataObject": [
5+
"sourceDataObjects": [
66
{
77
"name": "SourceTable"
88
}
99
],
1010
"targetDataObject": {
1111
"name": "TargetTable"
1212
},
13-
"dataItemMapping": [
13+
"dataItemMappings": [
1414
{
15-
"sourceDataItem": {
16-
"dataQueryCode": "SELECT 10/2"
17-
},
15+
"sourceDataItems": [
16+
{
17+
"dataQueryCode": "SELECT 10/2"
18+
}
19+
],
1820
"targetDataItem": {
1921
"name": "TargetColumn"
2022
}
2123
},
2224
{
23-
"sourceDataItem": {
24-
"name": "Column2Source"
25-
},
25+
"sourceDataItems": [
26+
{
27+
"name": "Column2Source"
28+
}
29+
],
2630
"targetDataItem": {
2731
"name": "Columns2Target"
2832
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"dataObjectMappings": [
3+
{
4+
"mappingName": "MappingOne",
5+
"sourceDataObjects": [
6+
{
7+
"name": "TableOneSource"
8+
},
9+
{
10+
"name": "TableTwoSource"
11+
}
12+
],
13+
"targetDataObject": {
14+
"name": "TableOneTarget"
15+
},
16+
"dataItemMappings": [
17+
{
18+
"sourceDataItems": [
19+
{
20+
"name": "ColumnOneSource"
21+
},
22+
{
23+
"name": "ColumnTwoSource"
24+
}
25+
],
26+
"targetDataItem": {
27+
"name": "ColumnOneTarget"
28+
}
29+
},
30+
{
31+
"sourceDataItems": [
32+
{
33+
"name": "ColumnTwoSource"
34+
}
35+
],
36+
"targetDataItem": {
37+
"name": "ColumnTwoTarget"
38+
}
39+
}
40+
]
41+
}
42+
]
43+
}

ClassLibrary/DataWarehouseAutomation/Test_Project/SampleFiles/sampleSimpleDDL.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dataObjectMappings": [
33
{
4-
"sourceDataObject": [
4+
"sourceDataObjects": [
55
{
66
"name": "HUB_CUSTOMER",
77
"dataItems": [

ClassLibrary/DataWarehouseAutomation/Test_Project/SampleFiles/sampleSourceQuery.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dataObjectMappings": [
33
{
44
"mappingName": "Mapping1",
5-
"sourceDataObject": [
5+
"sourceDataObjects": [
66
{
77
"dataQueryCode": "SELECT GETDATE()",
88
"dataQueryConnection": {
@@ -19,11 +19,13 @@
1919
"targetDataObject": {
2020
"name": "TableOneTarget"
2121
},
22-
"dataItemMapping": [
22+
"dataItemMappings": [
2323
{
24-
"sourceDataItem": {
25-
"name": "CURRENTDATE"
26-
},
24+
"sourceDataItems": [
25+
{
26+
"name": "CURRENTDATE"
27+
}
28+
],
2729
"targetDataItem": {
2830
"name": "CURRENTDATETIME"
2931
}

ClassLibrary/DataWarehouseAutomation/Test_Project/SampleFiles/sampleTEAM_Hub.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"notes": "The source-to-target mappings for a Hub entity type. The Hub entities define the business concept and integration point for the model. In the Virtual Data Warehouse, the generated views combine the metadata from the various source to target mappings to create a single integrated Hub query."
1717
}
1818
],
19-
"sourceDataObject": [
19+
"sourceDataObjects": [
2020
{
2121
"id": 0,
2222
"name": "PSA_PROFILER_PERSONALISED_COSTING",
@@ -32,12 +32,11 @@
3232
"dataConnectionString": "PersistentStagingDatabase"
3333
}
3434
},
35-
"dataItemMapping": null,
3635
"businessKey": [
3736
{
3837
"businessKeyComponentMapping": [
3938
{
40-
"sourceDataItem": {
39+
"sourceDataItems": {
4140
"name": "Segment+'TEST'",
4241
"dataType": null,
4342
"characterLength": 0,

0 commit comments

Comments
 (0)