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.
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;
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;