diff --git a/ballerina/metadata_types.bal b/ballerina/metadata_types.bal index 77b1b61..6a027db 100644 --- a/ballerina/metadata_types.bal +++ b/ballerina/metadata_types.bal @@ -18,9 +18,10 @@ import ballerina/persist; # Represents the metadata of an entity. # +# + keyFields - Array of strings containing key field names # + query - Function pointer to query records as a stream # + queryOne - Function pointer for query by key -# + associationMethods - Map of associated query function pointers +# + associationsMethods - Map of associated query function pointers public type TableMetadata record {| string[] keyFields; isolated function (string[]) returns stream query; diff --git a/ballerina/tests/init-tests.bal b/ballerina/tests/init-tests.bal index fc9df9e..f0441d5 100644 --- a/ballerina/tests/init-tests.bal +++ b/ballerina/tests/init-tests.bal @@ -220,48 +220,6 @@ public type AllTypesDependent record {| time:Civil? civilTypeOptional; |}; -OrderItemExtended orderItemExtended1 = { - orderId: "order-1", - itemId: "item-1", - CustomerId: 1, - paid: false, - ammountPaid: 10.5f, - ammountPaidDecimal: 10.5, - arivalTimeCivil: {"utcOffset":{"hours":5,"minutes":30},"timeAbbrev":"Asia/Colombo","dayOfWeek":1,"year":2021,"month":4,"day":12,"hour":23,"minute":20,"second":50.52}, - arivalTimeUtc: [1684493685, 0.998012000], - arivalTimeDate: {year: 2021, month: 4, day: 12}, - arivalTimeTimeOfDay: {hour: 17, minute: 50, second: 50.52}, - orderType: INSTORE -}; - -OrderItemExtended orderItemExtendedRetrieved = { - orderId: "order-1", - itemId: "item-1", - CustomerId: 1, - paid: false, - ammountPaid: 10.5f, - ammountPaidDecimal: 10.5, - arivalTimeCivil: {"timeAbbrev":"Z","dayOfWeek":1 ,"year":2021,"month":4,"day":12,"hour":17,"minute":50,"second":50.52}, - arivalTimeUtc: [1684493685, 0.998012000], - arivalTimeDate: {year: 2021, month: 4, day: 12}, - arivalTimeTimeOfDay: {hour: 17, minute: 50, second: 50.52}, - orderType: INSTORE -}; - -OrderItemExtended orderItemExtended2 = { - orderId: "order-2", - itemId: "item-2", - CustomerId: 1, - paid: false, - ammountPaid: 10.5f, - ammountPaidDecimal: 10.5, - arivalTimeCivil: {"utcOffset":{"hours":5,"minutes":30},"timeAbbrev":"Asia/Colombo","dayOfWeek":1 ,"year":2024,"month":4,"day":12,"hour":17,"minute":50,"second":50.52}, - arivalTimeUtc: [1684493685, 0.998012000], - arivalTimeDate: {year: 2021, month: 4, day: 12}, - arivalTimeTimeOfDay: {hour: 17, minute: 50, second: 50.52}, - orderType: ONLINE -}; - public type EmployeeInfo record {| string firstName; string lastName; @@ -271,47 +229,6 @@ public type EmployeeInfo record {| Workspace workspace; |}; -OrderItemExtended orderItemExtended2Retrieved = { - orderId: "order-2", - itemId: "item-2", - CustomerId: 1, - paid: false, - ammountPaid: 10.5f, - ammountPaidDecimal: 10.5, - arivalTimeCivil: {"timeAbbrev":"Z","dayOfWeek":5 ,"year":2024,"month":4,"day":12,"hour":12,"minute":20,"second":50.52}, - arivalTimeUtc: [1684493685, 0.998012000], - arivalTimeDate: {year: 2021, month: 4, day: 12}, - arivalTimeTimeOfDay: {hour: 17, minute: 50, second: 50.52}, - orderType: ONLINE -}; - -OrderItemExtended orderItemExtended3 = { - orderId: "order-3", - itemId: "item-3", - CustomerId: 4, - paid: true, - ammountPaid: 20.5f, - ammountPaidDecimal: 20.5, - arivalTimeCivil: {"utcOffset":{"hours":5,"minutes":30},"timeAbbrev":"Asia/Colombo","dayOfWeek":1,"year":2021,"month":4,"day":12,"hour":23,"minute":20,"second":50.52}, - arivalTimeUtc: [1684493685, 0.998012000], - arivalTimeDate: {year: 2021, month: 4, day: 12}, - arivalTimeTimeOfDay: {hour: 17, minute: 50, second: 50.52}, - orderType: INSTORE -}; - -OrderItemExtended orderItemExtended3Retrieved = { - orderId: "order-2", - itemId: "item-2", - CustomerId: 1, - paid: true, - ammountPaid: 10.5f, - ammountPaidDecimal: 10.5, - arivalTimeCivil: {"timeAbbrev":"Z","dayOfWeek":1 ,"year":2021,"month":4,"day":12,"hour":17,"minute":50,"second":50.52}, - arivalTimeUtc: [1684493685, 0.998012000], - arivalTimeDate: {year: 2021, month: 4, day: 12}, - arivalTimeTimeOfDay: {hour: 17, minute: 50, second: 50.52}, - orderType: ONLINE -}; public type DepartmentInfo record {| string deptNo; diff --git a/native/src/main/java/io/ballerina/stdlib/persist/inmemory/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/persist/inmemory/ModuleUtils.java index e453b21..f46c0a7 100644 --- a/native/src/main/java/io/ballerina/stdlib/persist/inmemory/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/persist/inmemory/ModuleUtils.java @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * - * WSO2 Inc. licenses this file to you under the Apache License, + * WSO2 LLC. licenses this file to you 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