The type of inheritance model supported by torque is one table per class
hierarchy.  torque objects cannot extend each other.  Patches are
welcome.

john mcnally

"Janssen, Roger" wrote:
> 
> Hi,
> 
> i'm trying to generate the OM classes with torque for a simple object model,
> consisting of two classes NUMBERED_OBJECT and MY_ASSET, where MY_ASSET is a
> subclass of NUMBERED_OBJECT.
> 
> The XML scheme i used is below:
> _______________________start________________________________
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
> <!DOCTYPE database SYSTEM "
> http://jakarta.apache.org/turbine/dtd/database.dtd";
> <http://jakarta.apache.org/turbine/dtd/database.dtd> >
> 
> <database
>  name="database2"
>  defaultIdMethod="idbroker"
>  package="demo.om">
> 
>  <table
>   name="NUMBERED_OBJECT"
>   javaName="NumberedObject"
>   idMethod="idbroker"
>   skipSql="false">
> 
>   <column name="NUMBER" primaryKey="true" required="true" size="20"
> type="VARCHAR"/>
> 
>   <column name="ENTITY_TYPE" inheritance="single" primaryKey="false"
> required="true" size="128" type="VARCHAR">
>    <inheritance key="ENTITY_ASSET" class="MyAsset"
> extends="demo.om.NumberedObject"/>
>   </column>
>  </table>
> 
>  <table
>   name="MY_ASSET"
>   javaName="MyAsset"
>   idMethod="idbroker"
>   skipSql="false">
> 
>   <column name="TEST_01" primaryKey="true" required="true" size="50"
> type="VARCHAR"/>
>   <column name="TEST_02" primaryKey="false" required="false" size="50"
> type="VARCHAR"/>
>  </table>
> 
> </database>
> ________________________________END XML ____________________________________
> 
> The problem is that non-compilable java code is being generated.
> Because of the inheritance, the generated class MyAsset now extends
> NumberedObject:
>        public class MyAsset extends demo.om.NumberedObject
> 
> This is what wanted, but normally MyAsset should extend BaseMyAsset, and in
> fact it still should.
> 
> Because of this, the generated OM base-peer classes are now non-compilable.
> It looks like the
> implemented inheritance model clashes with the implemented OM-peer model,
> cause in java only
> one class can be extended.
> 
> I do need to use subclasses, but i do not know how to implement them if
> above doesn't work!
> 
> Are my observations correct? How can i implement class hierarchy?
> 
> Roger Janssen
> 
> *************************************************************************
> The information contained in this communication is confidential and is
> intended solely for the use of the individual or entity to  whom it is
> addressed.You should not copy, disclose or distribute this communication
> without the authority of iBanx bv. iBanx bv is neither liable for
> the proper and complete transmission of the information has been maintained
> nor that the communication is free of viruses, interceptions or interference.
> 
> If you are not the intended recipient of this communication please return
> the communication to the sender and delete and destroy all copies.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to