Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OData and Integration Statements

Statements for managing OData services, external entities, and browsing service contracts.

Mendix supports consuming and publishing OData services. Consumed services (OData clients) connect to remote OData endpoints and make external entity types available for use in your application. Published services expose your domain model entities as OData endpoints for other applications to consume.

OData Client Statements

StatementDescription
CREATE ODATA CLIENTCreate a consumed OData service (auto-fetches $metadata)
ALTER ODATA CLIENTModify OData client properties
DROP ODATA CLIENTRemove a consumed OData service

OData Service Statements (Published)

StatementDescription
CREATE ODATA SERVICEPublish entities as an OData endpoint
ALTER ODATA SERVICEModify published service properties
DROP ODATA SERVICERemove a published OData service

External Entity Statements

StatementDescription
CREATE EXTERNAL ENTITYImport an entity from a consumed OData service
CREATE EXTERNAL ENTITIESBulk-create external entities from cached $metadata

CREATE EXTERNAL ENTITIES

Bulk-create external entities from a consumed OData service’s cached $metadata.

-- Create all entity types from the contract
CREATE EXTERNAL ENTITIES FROM Module.Service;

-- Create into a specific module
CREATE EXTERNAL ENTITIES FROM Module.Service INTO TargetModule;

-- Filter to specific entities
CREATE EXTERNAL ENTITIES FROM Module.Service ENTITIES (Customer, Order);

-- Idempotent — update existing entities
CREATE OR MODIFY EXTERNAL ENTITIES FROM Module.Service;

Contract Browsing Statements

Browse available assets from cached service contracts without network access.

StatementDescription
SHOW CONTRACT ENTITIES FROM Module.ServiceList entity types from cached $metadata
SHOW CONTRACT ACTIONS FROM Module.ServiceList actions/functions from cached $metadata
DESCRIBE CONTRACT ENTITY Module.Service.EntityShow entity properties, types, keys
DESCRIBE CONTRACT ENTITY Module.Service.Entity FORMAT mdlGenerate CREATE EXTERNAL ENTITY
DESCRIBE CONTRACT ACTION Module.Service.ActionShow action parameters and return type
SHOW CONTRACT CHANNELS FROM Module.ServiceList channels from cached AsyncAPI
SHOW CONTRACT MESSAGES FROM Module.ServiceList messages from cached AsyncAPI
DESCRIBE CONTRACT MESSAGE Module.Service.MessageShow message payload properties
StatementSyntax
Show OData clientsSHOW ODATA CLIENTS [IN module]
Show OData servicesSHOW ODATA SERVICES [IN module]
Show external entitiesSHOW EXTERNAL ENTITIES [IN module]
Show external actionsSHOW EXTERNAL ACTIONS [IN module]
Describe OData clientDESCRIBE ODATA CLIENT Module.Name
Describe OData serviceDESCRIBE ODATA SERVICE Module.Name
Describe external entityDESCRIBE EXTERNAL ENTITY Module.Name

Catalog Tables

After REFRESH CATALOG, the following tables are available for SQL queries:

TableContents
CATALOG.ODATA_CLIENTSConsumed OData services
CATALOG.ODATA_SERVICESPublished OData services
CATALOG.EXTERNAL_ENTITIESImported external entities
CATALOG.EXTERNAL_ACTIONSExternal actions used in microflows
CATALOG.CONTRACT_ENTITIESEntity types from cached $metadata
CATALOG.CONTRACT_ACTIONSActions/functions from cached $metadata
CATALOG.CONTRACT_MESSAGESMessages from cached AsyncAPI

Example: Find available entities not yet imported

SELECT ce.EntityName, ce.ServiceQualifiedName, ce.PropertyCount
FROM CATALOG.CONTRACT_ENTITIES ce
LEFT JOIN CATALOG.EXTERNAL_ENTITIES ee
  ON ce.ServiceQualifiedName = ee.ServiceName
  AND ce.EntityName = ee.RemoteName
WHERE ee.Id IS NULL;