Improve access and usage of database unique Identifier (ID) of records for advanced database operations - Mendix Forum

Improve access and usage of database unique Identifier (ID) of records for advanced database operations

1

The inability to use the Identifiers (ID) of records in Mendix Studio Pro Microflows, and overall in Mendix code, makes Mendix not usable for advanced database operations. Often times we have to work with existing databases where the only unique identifier on a record is the ID, this cannot be accessed or used in Mendix especially in tables created from Mendix 9 onward. I have a scenario where I have to write a batch processing of records, I need to select the records ordered by ID (there is no other unique identifier, I inherited this code and cannot change that fact), to ensure the batches do not repeat (and I tested it does not seem as if Mendix necessarily return records in ordered ID if selected without an ORDER BY clause), so I need to order the records by ID, then limit it to a certain number and offset to create batches, also to save overhead I do not want to select the other attributes in the entity since they contain huge text that I do not want to unecessarily load into memory, at first I thought I can select the ID using an OQL query, only to find I cannot, in Mendix 9 the ID is some or other structure and I have to cast it to a long, so I do that and got the ID, for the batch processing I create a record in a temporary staging table, then using this staging table in the processing I want to select the original record going forward using the ID, only to find that with a Retrieve widget of the original record in the original entity by ID is impossible. 

This is a huge drawback of Mendix for advanced developers and advanced data operations.

asked
0 answers