Map selected data to helper entity using Database Connector & SQL
0
Good day, I would like to know whether it is possible to “map” values of certain attributes on an entity to a helper entity, similar to that what is available with OQL, using SQL and the database connector? I am connecting to a PostgreSQL database and have created my helper entity to have the same attribute names and types as my target entity. Also, the application is in version 9.12.1 The error I get looks as follow: com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: databaseconnector.impl.DatabaseConnectorException: Database attribute 'uid' is not in the entity 'FlatLPT.OQLDisplayHelper'. Please check the entity 'FlatLPT.OQLDisplayHelper' attribute names with the database column names. at FlatLPT.SUB_RetrieveTest.nested.1fa5b9ce-b7c0-444d-a029-fd28b02e3b76 (JavaAction : 'Execute query') at FlatLPT.SUB_RetrieveTest ( : '') at FlatLPT.BTN_TestRetrieveTypes (SubMicroflow : 'SUB_RetrieveTest') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:83) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: databaseconnector.impl.DatabaseConnectorException: Database attribute 'uid' is not in the entity 'FlatLPT.OQLDisplayHelper'. Please check the entity 'FlatLPT.OQLDisplayHelper' attribute names with the database column names. The “origin” entity (partially) looks as follows: My “target” entity looks as follows: *(I’m reusing my OQL helper, hence the name) My SQL looks as follows: SELECT UID UID, SalesOrder SalesOrder, ProductOrder ProductOrder, Status Status, Step1Status Step1Status, Step2Status Step2Status FROM public."flatlpt$flatitem" WHERE salesorder='someUID';
asked
Nico Mouton
2 answers
0
Hi Nico,
Can you try renaming your entity attribute to “uid” ?
AFAIK, The attribute names should be exactly the same and it is also case sensitive.
I used the database connector once to map data from a PostgreSQL database into my mendix database. I only adjusted the ‘ResultSetIterator.java file to make it generic. Because if you use the standard database connector. The attribute names should be exactly the same, otherwise you will get:
final String msg = "The entity type '%s' does not contain the primitive '%s' as specified in the query.";