Hi!
I'm trying to use torque in a proyect, but I can't
figure out how to implement inheritance...
I've looking an Torque User's Guide, Torque mailing list
archive, Turbine User mailing list archive, Torque Schema Reference
but I can't get any explanation about doing anything like this:
+-------+
| A | <---- UML-like class diagram
+-------+
|aaa1 |
|aaa2 |
+---+---+
|
+----+----+
| |
+---+---+ +---+---+
| B | | C |
+-------+ +-------+
|bbb1 | |ccc1 |
|bbb2 | |ccc2 |
+-------+ +-------+
I've seen that I'd have to do something like this:
...
<table name="A">
<column name="aaa1" type="INTEGER"/>
<column name="aaa2" type="INTEGER"/>
<column name="FOO" inheritance="single" type="CHAR" size="1">
<inheritance key="B" class="B" extends="com.mycompany.project.om.A"/>
<inheritance key="C" class="C" extends="com.mycompany.project.om.A"/>
</column>
</table>
...
and torque "... can map a class hierarchy into a single table ...",
so, I have to put all attributes from 'B' and 'C' in the 'A' table...
...
<table name="A">
<column name="aaa1" type="INTEGER"/>
<column name="aaa2" type="INTEGER"/>
<column name="FOO" inheritance="single" type="CHAR" size="1">
<inheritance key="B" class="B" extends="com.myco.om.A"/>
<inheritance key="C" class="C" extends="com.myco.om.A"/>
</column>
<column name="bbb1" type="INTEGER"/>
<column name="bbb2" type="INTEGER"/>
<column name="ccc1" type="INTEGER"/>
<column name="ccc2" type="INTEGER"/>
</table>
...
How could I tell torque that 'bbb1' and 'bbb2' are for the child
class 'B' and 'ccc1' and 'ccc2' are for the child class 'C'?
I suppose that 'aaa1' and 'aaa2' go to 'B' and 'C' automatically,
if I'am wrong, please let me know...
ANY HELP IS WELLCOME!!!
Thanks in advance.
Horacio
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>