Vlad, could you please expand a little on your answer?
I already tried using @JoinFormula, but the problem I ran into was that Hibernate generated a sub-select query inside the outter join condition, resulting in
Code:
"ORA-01799: a column may not be outer-joined to a subquery"
error. So that didn't work either.
It is possible that I used @JoinFormula wrong though. Could you please show me how to do it correctly? The details of what I tried are here:
https://stackoverflow.com/questions/465 ... nheritanceBut to summarize, I did:
Code:
@ManyToOne
@JoinColumnsOrFormulas([
@JoinColumnOrFormula(formula = @JoinFormula(value = "(APPLICATION_OID)", referencedColumnName="APPLICATION_OID")),
@JoinColumnOrFormula(formula = @JoinFormula(value = "(select apv.PROJECT_VERSION_OID from DFIP_PROJECT_VERSION pv, DFIP_APPLN_PROJ_VERSION apv where apv.PROJECT_VERSION_OID = pv.PROJECT_VERSION_OID and apv.APPLICATION_OID = APPLICATION_OID and pv.PROJ_VSN_EFF_TO_DTM is null)", referencedColumnName="PROJECT_VERSION_OID")),
])
ApplicationProjectVersion latestVersion;
What is the correct way to do it?