Mendix association problem with external database

0
Hello,   I'm a new Mendix developer, recently I want to code a new web with external Oracle database, but get some association problem. The detail was, When I use Mendix build in database, it's very easy to use assocaition, for example, I can create a users table to store how many users are using computers, and a computers table to store all the computers. Then link two tables to identify the computer owners like below table. but when I use external Oracle table, I must add an ID column in each table like below, Add two entities same as Oracle in Mendix,   but when I use database connector in microflow for data grid data source, but can't display user name in the list, When I only use Owner ID in the data grid, it will display owner id in the web page, When I want to display the user name in the page by using association like below picture, There is only blank in user id column, If I want to show user name in user ID column, how can I do in this case? PS: we want to store all the data in external ORACLE database instead of build in database.    
asked
1 answers
0

Hey Jianfeng,

 

Can you also share query what are using inside the microflow ? But before I troubleshoot further, I want to share some information about associations in mendix.

 

In this example you tried over querying users table and computers table, have you tried querying over computers_owners table ? For every association, mendix creates a new table with the name provided in association, it will have only 2 columns and that will be the gids of both table. So whenever you set association to an object, in db, it will create new record to this association table and store gid of both columns and when Mendix does the lookup for associations, it will do lookup in associated table as well.

 

Now what you can check in Oracle db is that such table exists holding any information. If answer is yes, then the association must works (which is not the case here), then I suggest you modify oql query by applying joins and manually retrieve the user name and set it to the fields.

 

Hope this helps

 

Thanks & Regards,

Naman Khard

answered