@@ -1199,19 +1199,21 @@ SNIPPET '{"orderId": 100, "customer": {"name": "Alice", "email": "alice@example.
11991199--
12001200-- Maps a flat JSON structure to a single non-persistent entity.
12011201
1202- CREATE ENTITY RestTest.PetResponse (NON_PERSISTENT)
1203- PetId: Integer;
1204- Name: String;
1205- Status: String;
1202+ CREATE NON-PERSISTENT ENTITY RestTest.PetResponse (
1203+ PetId: Integer,
1204+ Name: String,
1205+ Status: String
1206+ );
1207+ /
12061208
12071209CREATE IMPORT MAPPING RestTest.IMM_Pet
12081210 FROM JSON STRUCTURE RestTest.JSON_Pet
12091211{
12101212 "" AS RestTest.PetResponse (Create) {
1211- id AS PetId (Integer, KEY);
1212- name AS Name (String);
1213- status AS Status (String);
1214- };
1213+ id AS PetId (Integer, KEY),
1214+ name AS Name (String),
1215+ status AS Status (String)
1216+ }
12151217};
12161218
12171219-- ============================================================================
@@ -1220,41 +1222,49 @@ CREATE IMPORT MAPPING RestTest.IMM_Pet
12201222--
12211223-- Maps a nested JSON structure to multiple entities linked by associations.
12221224
1223- CREATE ENTITY RestTest.OrderResponse (NON_PERSISTENT)
1224- OrderId: Integer;
1225+ CREATE NON-PERSISTENT ENTITY RestTest.OrderResponse (
1226+ OrderId: Integer
1227+ );
1228+ /
12251229
1226- CREATE ENTITY RestTest.CustomerInfo (NON_PERSISTENT)
1227- Name: String;
1228- Email: String;
1230+ CREATE NON-PERSISTENT ENTITY RestTest.CustomerInfo (
1231+ Name: String,
1232+ Email: String
1233+ );
1234+ /
12291235
1230- CREATE ENTITY RestTest.OrderItem (NON_PERSISTENT)
1231- Sku: String;
1232- Quantity: Integer;
1233- Price: Decimal;
1236+ CREATE NON-PERSISTENT ENTITY RestTest.OrderItem (
1237+ Sku: String,
1238+ Quantity: Integer,
1239+ Price: Decimal
1240+ );
1241+ /
12341242
12351243CREATE ASSOCIATION RestTest.OrderResponse_CustomerInfo
12361244 FROM RestTest.OrderResponse
12371245 TO RestTest.CustomerInfo;
1246+ /
12381247
12391248CREATE ASSOCIATION RestTest.OrderResponse_OrderItem
12401249 FROM RestTest.OrderResponse
12411250 TO RestTest.OrderItem;
1251+ /
12421252
12431253CREATE IMPORT MAPPING RestTest.IMM_Order
12441254 FROM JSON STRUCTURE RestTest.JSON_Order
12451255{
12461256 "" AS RestTest.OrderResponse (Create) {
1247- orderId AS OrderId (Integer, KEY);
1257+ orderId AS OrderId (Integer, KEY),
12481258 customer AS RestTest.CustomerInfo (Create) VIA RestTest.OrderResponse_CustomerInfo {
1249- email AS Email (String);
1250- name AS Name (String);
1251- };
1259+ email AS Email (String),
1260+ name AS Name (String)
1261+ },
12521262 items AS RestTest.OrderItem (Create) VIA RestTest.OrderResponse_OrderItem {
1253- price AS Price (Decimal);
1254- quantity AS Quantity (Integer);
1255- sku AS Sku (String);
1256- };
1257- };
1263+ price AS Price (Decimal),
1264+ quantity AS Quantity (Integer),
1265+ sku AS Sku (String)
1266+ }
1267+ }
12581268};
12591269
12601270-- ############################################################################
@@ -1273,10 +1283,10 @@ CREATE EXPORT MAPPING RestTest.EMM_Pet
12731283 TO JSON STRUCTURE RestTest.JSON_Pet
12741284{
12751285 RestTest.PetResponse AS root {
1276- PetId AS id (Integer);
1277- Name AS name (String);
1278- Status AS status (String);
1279- };
1286+ PetId AS id (Integer),
1287+ Name AS name (String),
1288+ Status AS status (String)
1289+ }
12801290};
12811291
12821292-- ============================================================================
@@ -1290,17 +1300,17 @@ CREATE EXPORT MAPPING RestTest.EMM_Order
12901300 NULL VALUES LeaveOutElement
12911301{
12921302 RestTest.OrderResponse AS root {
1293- OrderId AS orderId (Integer);
1303+ OrderId AS orderId (Integer),
12941304 RestTest.CustomerInfo VIA RestTest.OrderResponse_CustomerInfo AS customer {
1295- Email AS email (String);
1296- Name AS name (String);
1297- };
1305+ Email AS email (String),
1306+ Name AS name (String)
1307+ },
12981308 RestTest.OrderItem VIA RestTest.OrderResponse_OrderItem AS items {
1299- Price AS price (Decimal);
1300- Quantity AS quantity (Integer);
1301- Sku AS sku (String);
1302- };
1303- };
1309+ Price AS price (Decimal),
1310+ Quantity AS quantity (Integer),
1311+ Sku AS sku (String)
1312+ }
1313+ }
13041314};
13051315
13061316-- ############################################################################
0 commit comments