db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owens, Ryan" <row...@uhd.com>
Subject Inheritance with extra columns. (full question)
Date Fri, 18 Jul 2003 21:46:56 GMT
Sorry about the premature send last time...  ctrl-Enter gets me every time.
---------------------------------------

I've seen a few similar questions a little while ago but no responses, sorry if I missed something.

I'm trying to do some inheritance between tables and from what I've read and tried so far
it seems that the default inheritance model in torque won't let me add new columns to 'subclasses'
of another table. 

For instance, this schema:
<table name "test">     
     <column
         name="id"
         required="true"
         primaryKey="true"
         type="INTEGER" />
     <column name="inheritance" inheritance="single"
         type="CHAR">
         <inheritance class="FooTest"
             extends="com.test.om.Test"  />
         <inheritance class="BarTest"
             extends="com.test.om.Test"
             key="B" />
     </column>     
</table>

creates these classes:

-BaseTest
-BaseTestManager
-BaseTestPeer
-Test
-TestManager
-TestPeer

-FooTest
-BarTest

FooTest and BarTest simply subclass Test and add:
-setInheritance(TestPeer.CLASSKEY_A);

So, the question is, is it possible to build a schema where FooTest has additional columns
of its own?
Any sample schema's would be very helpful.

If this is not possible with the default inheritance model, then can I accomplish it with
the Scarab example in the Inheritance docs?
If so, has anyone else gotten a head start and maybe a few tips?

Thanks very much!

   Ryan Owens

Mime
View raw message