We have a legacy schema that I am using to retrieve data from using Hibernate 3. I have a provider and address entities. A provider can have many addresses. But the join isn't simple. I'm struggling to come up with my relationship mapping for this scenario.
If I were to write my own sql, the sql to join the data would be something like this:
Code:
select *
from provider p inner join address a on trim(p.prov_nbr) = trim(a.addr_nbr) and trim(a.addr_mode) = 'P' and a.addr_type = 'D'
Anyone have any thoughts?