Features Details
Some important REST feature details.
Queries
ViewAll | ViewAllPaged | SelectWhere | <table>Query | DataMesh
Following Query variants are provided in generated code.
- ViewAll
- ViewAllPaged
- SelectWhere
- <table>Query
- DataMesh
- FindOne
- GetOne
ViewAll, ViewAllPaged, <table>Query are self-explanatory.
Search, Filter, Sorting
Query SelectWhere : Flexible SQL-Like Querying
Query type SelectWhere empowers developers in extending data filtering on-the-fly to any columns needed, and also empowers end-users with flexible filter selections via UI Filter Screen.
Please refer to a file from our Graphql section
...\emapi\app\dbgraphql\GraphQL_Readme.txt
for full details on using it, syntax, operators supported and examples.
Some excerpts here:
* Example: searchBy string: " invQty > 100 and invLocation = 'USA' and invDate = '2022-10-20 14:20' and invCost isNotNull 0 "
* Example: sortBy string: " invQty desc , invMinQty desc "
Data Federation | Data Mesh
A default DataMesh Query is provided in generated code. That can be easily customized further. Refer to REST APIs Customize section here.
Nested Models and Objects
Implementing Nested Objects is easy. Configure Table-to-Table Joins and Multi-Table Relations. Generate code. Complete use case via Low-Code Customize.
Please refer to One-to-many relationship section on this page for example of Nested Model.
REST Data Modeling
Please refer to common reference on Data Modeling
In this feature details page, we give examples of REST Data Modeling with 1x1, 1xM and MxM relationships.
One-to-one relationship
1x1 relationship between two tables.
1x1 Table Join example
Table Join:
Srl Left Table Lt Tbl Id Relationship Right Table Rt Tbl Id Defn Id
1 erp_inventory 5004391 1x1 erp_product 5004393 5000113
API generated:
http://127.0.0.1:9080/emdbrest/ErpInventory/ErpInventoryErpProduct5000113/FindOne?invId=1
Payload:
{
"invId": 1,
"productId": 1,
"invDate": "2023-02-19T00:00:00.000+05:30",
"invQty": 10,
"invMinQty": 2,
"invCost": 50,
"invLocation": "USA",
"erpProduct": {
"productId": 1,
"productName": "Amoxicillin",
"productCategory": "Antibiotics",
"primarySupplier": "Lupin",
"productDesc": null,
"productPicture": null
}
}
One-to-many relationship
1xM relationship between two tables.
1xM Table Relation example with multiple tables
Tables Relation:
Srl Left Table Lt Tbl Id Relationship Right Table Rt Tbl Id Defn Id
1 erp_product 5004393 1xM erp_inventory 5004391 5000112
2 erp_inventory 5004391 1x1 erp_inventory_vw 5004399 5000114
API generated:
http://127.0.0.1:9080/emdbrest/ErpProduct/ErpProductErpInventory1Multi/FindOne?productId=1
curl call:
curl -X 'GET' \
'http://127.0.0.1:9080/emdbrest/ErpProduct/ErpProductErpInventory1Multi/FindOne?productId=1' \
-H 'accept: application/hal+json'
Payload:
{
"productId": 1,
"productName": "Amoxicillin",
"productCategory": "Antibiotics",
"primarySupplier": "Lupin",
"productDesc": null,
"productPicture": null,
"erpInventoryErpInventoryVw": [
{
"invId": 1,
"productId": 1,
"invDate": "2023-02-19T00:00:00.000+05:30",
"invQty": 10,
"invMinQty": 2,
"invCost": 50,
"invLocation": "USA",
"erpInventoryVw": {
"invId": 1,
"productId": 1,
"productName": "Amoxicillin",
"invDate": "19/02/23",
"invQty": 10,
"invMinQty": 2,
"invCost": 50,
"invLocation": "USA"
}
},
{
"invId": 2,
"productId": 2,
"invDate": "2023-02-19T00:00:00.000+05:30",
"invQty": 20,
"invMinQty": 4,
"invCost": 100,
"invLocation": "USA",
"erpInventoryVw": {
"invId": 1,
"productId": 1,
"productName": "Amoxicillin",
"invDate": "19/02/23",
"invQty": 10,
"invMinQty": 2,
"invCost": 50,
"invLocation": "USA"
}
}
]
}
Many-to-many relationship
MxM relationship between two tables.
MxM Table Relation example
Table Join:
Srl Left Table Lt Tbl Id Relationship Right Table Rt Tbl Id Defn Id
1 erp_product 5004393 1xM erp_inventory 5004391 5000112
API generated:
http://127.0.0.1:9080/emdbrest/ErpProduct/ErpProductErpInventory5000112/ViewAllPaged?page=0&size=2
Payload:
[
{
"productId": 1,
"productName": "Amoxicillin",
"productCategory": "Antibiotics",
"primarySupplier": "Lupin",
"productDesc": null,
"productPicture": null,
"erpInventory": [
{
"invId": 1,
"productId": 1,
"invDate": "19/02/23",
"invQty": 10,
"invMinQty": 2,
"invCost": 50,
"invLocation": "USA"
},
{
"invId": 2,
"productId": 1,
"invDate": "19/02/23",
"invQty": 20,
"invMinQty": 4,
"invCost": 100,
"invLocation": "USA"
}
]
},
{
"productId": 2,
"productName": "Azithromycin",
"productCategory": "Antibiotics",
"primarySupplier": "Abbot",
"productDesc": null,
"productPicture": null,
"erpInventory": [
{
"invId": 1,
"productId": 2,
"invDate": "19/02/23",
"invQty": 10,
"invMinQty": 2,
"invCost": 50,
"invLocation": "USA"
},
{
"invId": 2,
"productId": 2,
"invDate": "19/02/23",
"invQty": 20,
"invMinQty": 4,
"invCost": 100,
"invLocation": "USA"
}
]
}
]
Setup
Setup Security & Authentication
Customize - Authorize Access
- Security - Role/User based Auth.
API Customization
Handle inserting data to 2 tables via API Created on View
Troubleshooting FAQs