Currently I have a table and columns mapped to class objects
<class name=com...patient table=patients dynamic-update=true mutable=true ..
<component name=myRef class=com...refDisplay ..>
<property name=id column=myRefFieldId />
After mapping an object I lookup all the reference ids in a hashmap and populate the object.
What I would like, on retrieving the data is to use a view or otherwise join to the reference fields
e.g.
select r1.display as sex, p.sex_id, r2.display as race, p.race_id, ...
from patients p, reference r1, reference r2
where p.sex_id = r1.reference_id
and p.race_id = r2.reference_id
...
This is more efficient than populating the object after selecting a row.
However if I was updating a row I guess I wouldnt want it to use the view or join to reference.
Is this possible?
|