db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Galil <guy_ga...@guardium.com>
Subject Re: Inheritance
Date Wed, 17 Nov 2004 14:41:35 GMT
As I understand it since bothe Resource and HumanResource classes are
based on the same database table all columns are visible by both,
inheritance is useful when you need to implement different processing
not for different attributes.

  On Wed, 2004-11-17 at 08:01, Christian Plate wrote:
> Hello Torque-users,
> 
> I have problem with Inheritance and Torque. The Inheritance Guide 
> (http://www.ingrid.org/jajakarta/turbine/en/turbine/torque/inheritance-guide.html) 
> describes how to define a subclass.
> 
> But I can't find a way to define extra columns for my subclass.
> 
> The example below works great, a subclass HumanResource is generated. But how 
> do i get extra columns for HumanResources?
> 
> Thanks in advance,
>   Christian
> 
> <table name="Resource" description="Resource">
>     <column
>       name="id"
>       required="true"
>       primaryKey="true"
>       type="INTEGER"
>     />
>     <column
>       name="name"
>       type="VARCHAR"
>       description="Name of this Resource"/>
>     />
>     <column
>      name="class_type"
>      type="VARCHAR"
>      inheritance="single">
>       <inheritance key="human_resource"
>             class="HumanResource"
>             extends="Resource"/>
>     </column>
> 
>   <column
>      name="class_type"
>      type="VARCHAR"
>      inheritance="single">
>       <inheritance key="human_resource"
>             class="HumanResource"
>             extends="Resource"/>
>     </column>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 


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