[eclipselink-users] Custom SQL for relationship
I have to entites: Employee, Company.
An Employee can be employed in many Companies, but there is a special Company which should be interpreted as the default one (there is a Relationship entity as well, and there are complex conditions when a company is default or not). Is there a way to tell EclipseLink, that this attribute should be getted with a special query?
We've implemented the complex logic in a stored procedure, so for an employee ID we can get the company's ID using the stored procedure, we could tweak it for returning a whole Company row, is there a way to tell EclipseLink use this stored procedure when we call Employee#getDefaultCompany()?
Thanks for your help!