Thursday, September 5, 2019

"Each row in the Query Result Columns must be mapped to a unique query attribute in the Mapped Entity columns"

When you are extending a VO you can quite often run in to the error "Each row in the Query Result Columns must be mapped to a unique query attribute in the Mapped Entity columns". The error is related to the view object you are trying to extend and indicates that there is something wrong with it. If you search for this error on My Oracle Support you will see that the fix is to get a patch that replaces the base VO that the problem is related to.

One potential error is that there are some CASE problems in the base VO declaration. For example, a selected column is named PartyId in the query but under Attributes the name is partyId. Though java is case-sensitive you can run into problems.

If you google this problem you will find a few different potential solutions, but of the ones I have found, the solution below is the most reliable.

  1. Create your extended view object without changing anything.
  2. Open up you newly created VO and click on the tree node "Attributes".
  3. Click the "New..." button and create your new column (a transient attribute will be created).
  4. Save and reopen the VO.
  5. Now change the Query Statement and add the new column in your select (the new column must have the same alias as the column added in step 3).
  6. Save and reopen the VO.
  7. Change the attribute you added in step 3. Make sure you check "Mapped to Column or SQL" and that the rest of the settings are correct.
  8. Done
Note: When I have added the column in the select statement I sometimes get errors in the attribute names (the error can be seen under the "Attributes" tree node).
 - two many attributes
 - the names are corrupted

To fix this error close the VO declaration and go to the file system and open up the <VO>.xml. Edit the file and correct the errors and repoen the VO in jDeveloper.

No comments:

Post a Comment

AME (Approval Management Engine)

AME (Approval Management Engine) : AME Stands for Oracle Approval Management Engine. AME is a self service web application that enables...