Ok. I've been around this so many time and, as much as I believe this might be easier than I think, I just can't get to a solution.
My problem is this: I have a database with tables I'm not allowed to alter. I also have a class diagram with extensive use of inheritance that I dind't want to alter much. I'm mapping using a table-per-class hierarchy approach, using subclass tags.
Let's just say I have this class CLASS with attributes A B and C. A and B map to fields X and Y in table TABLE1, but C maps to field Z in table TABLE2.
I was mapping something like this:
Code:
<class>
name="CLASS"
table="TABLE1"
discriminator-value="...">
(...)
<property
name="A"
column="X"
type="..."/>
<property
name="B"
column="Y"
type="..."/>
(...)
</class>
Now what I don't know is how to add something like a property tag but referencing a single field Z in TABLE2. I understand it has something to do with one-to-one assotiations, but I still don't know how is this to be done.
Thanks in advance for your replies.