Maybe it's just me, but I'm finding the xml mappings for Hibernate to be impossible. If someone could help out with this example, I'd be grateful.
I have two tables
AREA(area, area_id) -- They key is the whole row
DISTRICT (district_id, area_id, district) -- They key is the whole row
My pojo District object wants to know it's district_id, area_id, district, and the corresponding area to its area_id.
The sql would be something like:
Code:
Select district.district_id, district.district_name, district.district_area_id, area.area from AREA area, DISTRICT district where area.AREA_ID = district.district_area_id and district_id = ?
I don't want to fuss with an Area object but would rather just query that AREA table for this one field. I believe this is a unidirectional one-to-many association on a foreign key. I'm not sure how to go about this with Hibernate since my "keys" are "composite" and I'm not doing a join.
Any ideas?