Almost a year ago I wrote this post about a ViewCriteria issue when using the same attribute twice in Oracle JDeveloper 12.1.3.0. Now I came across another issue with ViewCriteria, in Oracle JDeveloper 12.2.1.0 this time, again related with a multiple insertion of an attribute but with a more complex scenario this time.
Consider having an attribute with applied LOV that is selected from an lov switcher attribute and this lov switcher gets its value from an EL expression (or from java). I used the Oracle HR schema to reproduce this, so you need to have something like the following:
Now create ViewCriteria for this viewObject and have JobId attribute more than once. Like the example:
If you create a query page on employees using this criteria and try to run it you will get an exception “oracle.jbo.NoDefException: JBO-25058: Definition JobLovSwitcher of type Attribute is not found in JobId.“. The same exception you will get if you are using criteria that contains the JobId only once and you try to add it more times through the Advanced -> Add fileds option on your page.
If no switcher is used everything works as should and the attribute can be selected many times. The issue is also reproduced if the switcher gets its value through java code. I cannot find a patch or a workaround for this in Oracle Support. In the unique scenario described though, you are going to need a different approach to query your data.
Oracle logged it as a bug.
See Bug 23324620:
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=1jlz8xhjb_134&_afrLoop=185443620497932