db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Bauman <g...@bravenet.com>
Subject Re: Mapping fields to subclasses in XML schema
Date Sat, 01 Mar 2003 21:40:57 GMT
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: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 



Mime
View raw message