db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Bauman <g...@bravenet.com>
Subject Mapping fields to subclasses in XML schema
Date Thu, 27 Feb 2003 19:46:19 GMT
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


Mime
View raw message