associating to same entity from two different columns when replicating data

Hi, Does anyone know how to create two different associations to the same entity (different objects) when using the database replication module? I have a groups table associated with an address table sql server. In the address table there two ids; OfficeAddressID and InvoiceAddressID columns, and in my new Mendix model my address table will take the two entries as AddressID only. In the table mappings, when creating the association, the attributes OfficeAddressID to AddressID works fine, but the second association from invoiceAddressID to AddressID will give me a warning stating that it has already been mapped to same attribute (makes sense). So I have created a new mapping that would just take the association, but an attribute is needed, so I've added that too since it will only create a new object in case it doesn't find the attribute (I think). I'm now expected to see the Group table with two associated addresses, and what I see is that the first address association has been removed, and I see no addresses for the group. How can I had the two associations based on the two different columns from the same original table?! LR.
2 answers

Do i understand you correctly that you want to combine 2 rows into 1?

If so you need to use a microflow in your mapping that uses your AddressID and your invoiceAddressID as input and stores this into your object. That way you can have your 2 -> 1 mapping without overwriting it.


Can't you create a module in your project to inititally map all your data to and then use microflows to properly fill in all this data into your actual project?

For example, create a module DatabaseReplication and add an entity group, with 2 attributes: OfficeAddress and InvoiceAddress and copy your database. Then use a simple microflow to properly map this data to your actual project.