I set up a simple interface to maintain the subclass-to-column relationships. If a subclass tries to access an inappropriate field I just throw an exception. I also had to override the copy() method to allow casting back to the subclass.
Please someone let us know if there is an easier way.
Sincerely, Travis McCauley Snowy Virginia
I don't suppose anyone can enlighten me on the below message? I didn't hear from anyone. Sorry for the spam, I won't ask again. ;)
Gabe
Gabriel Bauman wrote:Hi there. I understand that classes and their subclasses are mapped onto a single table under Torque. What I don't understand is how to specify that a field should only be retrieved in a subclass.
===== public class SuperClass { public int FOO; }
public class SubClass extends SuperClass { public int BAR; } =====
<table name="superclass" javaName="SuperClass"> <column name="FOO" type="int" /> <column name="BAR" type="int" /> <column name="inheritance" inheritance="single" type="CHAR"> <inheritance class="SubClass" extends="SuperClass" key="A" /> </column> </table>
=====
I want to be sure that field BAR does not exist in instances of SuperClass, given the fact that they're both mapped on the same table. How should my XML schema look in this situation? I must be missing something simple here.
Thanks in advance...
Gabe
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
