db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Emminger <e...@ericemminger.com>
Subject Re: Mapping fields to subclasses in XML schema
Date Mon, 03 Mar 2003 16:47:44 GMT
I'll take a stab at this! :)

 >>> 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.

Since you want BAR in SubClass but not in SuperClass, define your schema 
as below.

<table name="superclass" javaName="SuperClass">
   <column name="FOO" type="INTEGER" inheritance="single">
     <inheritance key="SubClass" class="SubClass" extends="SuperClass" />

<table name="subclass" javaName="SubClass">
   <column name="BAR" type="INTEGER" />

So you know, all I did was generate the OM and look at the Java files. 
Everything looks correct, but that's all I did, so I may have missed 

Please, let me know whether or not this works for you.


View raw message