Query Generation from Domain Model

0
Is there a way to generate a Query from the domain model association?
asked
4 answers
2

John,

 

You can query the mendix database using OQL. Here is the mendix documentation for OQL

https://docs.mendix.com/refguide/oql

answered
2

Hi John,

Check these learning modules.

How to retrieve/show (bind) data to pages: https://gettingstarted.mendixcloud.com/link/module/5/lecture/86

How to retrieve data in mircroflows: https://gettingstarted.mendixcloud.com/link/module/8/lecture/195

answered
0

- In the console, dropdown 'Advanced' set the loglevel of each ConnectionBus_* to Trace. That will get you the SQLs the database is receiving.

- In the console, dropdown 'Advanced' select the built in databaseviewer.

answered
0

John,

It sounds like you want to verify the data in an association maintained by Mendix (in your question you said you wanted to query a domain model association).  If this is the case, there is not a way to programatically retrieve that data from the database.  You could retrieve that data using an external tool but I'm not sure that would be very useful - that data in association tables consists of 2 Mendix guid's which don't have any meaning outside of the Mendix app.  As an example, suppose I have an association called DocumentTypes_Client, Mendix will create and maintain the following table to manage this association:

You can see the data wouldn't be useful.

If you want to verify some data that has come from an external system, you could do that in one of two ways:

  1. Perform the validation inside of Mendix.  To do this, you would use XML Schemas and Import to bring the external system data into Mendix and then build a microflow that would perform the validations you need.  This how to will get you started on importing XML data into your Mendix app: https://docs.mendix.com/howto/integration/importing-xml-documents
  2. Perform the validation outside of Mendix.  In this case, you'll probably want to provide easy access to Mendix data for an external application.  You can do this in a few ways.  You could either expose just the data using OData (https://docs.mendix.com/howto/integration/exposing-data-to-bi-tools-using-odata) or if your requirements are more complex, create a webservice with operations as needed (https://docs.mendix.com/howto/integration/expose-a-web-service)

 

Maybe some of that is helpful to you.

Mike

answered