In my application, I have 2 entities called Employee and Employment. Since an employee can get a promotion to a higher position, there is a One-to-Many relationship from Employee to Employment by default. However, at any point of time, there can only be one active employment. Hence, I created a custom One-to-One Association called EmployeeToActiveEmploymentAssoc. For it to be One-to-One, I edited the Where clause for Employee to Employment to include "AND Employment.ACTIVE = 1".
The above association works fine if I call it from Groovy or Java - i.e. calling getActiveEmployment() always return me only 1 record. However, when I tried to create a View Object using the above 2 entities and selected my custom Association as the link between the 2 entities, the Query section of the View Object does not reflect my custom Where clause. The Where clause appears to be the default clause: "Employee.EmployeeNo = Employment.EmployeeNo". As a consequence, this View Object always return all Employment records of an Employee.
I'd like to ask if this is an expected behaviour from ADF. If that's not the case, I'd very grateful if you could let me know what I have done wrong.
***UPDATE:*** My JDeveloper version is Build JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493