Retrieve Data Help. Sql 2012

0
so in my app, i have entities exactly similar to my database tables. i have in my project "DataBase Replication" and "Module mx Reflection" so this helps with mapping the tables to the entities. Finally i import the data. So i two main issues : Everyone can drag a associated attribute onto the form and Mendix will through the relation know what your trying to get. My issue here is, the association mapping seems not to have happened because i imported the data, so i have to write microflows, this is very hard and time consuming. is there a way to fix the associations? Importanting the data, is once off, how can i go about mendix getting the latest data?
asked
1 answers
1

For a once-off migration, I would suggest creating a separate module with separate, 'in-between' entities that also store the PK/FK relations. Then use microflows to process your data and set associations correctly. Build seperate microflows to clean up your 'in-between' entities afterwards if needed, and the whole module can be removed in a next release after your data migration has been completed.

For regular synchronizing with a database, I would suggest writing custom SQL queries (using the Replication Module or just plain SQL).
You can execute these using some microflow logic and some small modifications to the DatabaseReplication module, directly afterwards executing more microflow logic to import the data properly including associations. Perhaps also with a scheduled event, or the microflow scheduler module?

Basically, there is no ready-to-go, straight forward way to put in place DB synchronization with an external DB. This will always take a bit of time and effort to do.

answered