Hello,
We are trying to use Hibernate with one of the existing legacy DB systems. We have a requirement where we need to map a query like the one below to a java object and I would like to know if it is possible.
DB SQL:
select A.F1,A.F2,E.F3,E.F4
from T1 A, T2 B, (select C.F3 AS F3, D.F4 AS F4 from T3 C, T4 D where T3.F4 = T4.F5) E
where A.F3 = B.F1 AND B.F2 = E.F3
Here are the tricky parts
1. SELECT columns doesn't include any fields from Table T2(B). T2 is only used as a mapping table between A and C. Is it possible to have tables in Hibernate without mapping columns to any Java classes
2. Table E is actually a nested query resultset
Could anyone let me know if this is something that can be implemented using Hibernate?
One alternative is to define a DB view and then map the class to the view but I am looking to avoid creating new DB objects.
Please advise
Thanks,
SG
|