db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Holcomb <w...@himinbi.org>
Subject use a torque generated class as a base class
Date Mon, 31 Mar 2003 23:12:30 GMT
I have a project with several tables (~30) and I currently have them
broken up into subprojects. I would like to specify some tables that join
between projects, but am having some trouble doing so.

One example is there is a project that is a discussion board and another 
that is a basic content management system. Every major thing in the 
content management system has a discussion conference associate with it, 
so I the joining project looks like:

<table name="artifact" javaName="OPSArtifact" alias="Artifact"
  <column name="id" required="true" primaryKey="true" type="INTEGER" />

<table name="conference" javaName="OPSConference" alias="Conference"
  <column name="id" required="true" primaryKey="true" type="INTEGER" />

<table name="artifact_conference" description="Conference for an artifact">
  <column name="id" required="true" primaryKey="true" type="INTEGER"/>
  <column name="artifact_id" required="true" type="INTEGER"/>
  <column name="conference_id" required="true" type="INTEGER"/>

  <foreign-key foreignTable="artifact" onDelete="cascade" onUpdate="cascade">
    <reference local="artifact_id" foreign="id"/>
  <foreign-key foreignTable="conference" onDelete="cascade" onUpdate="cascade">
    <reference local="conference_id" foreign="id"/>

Ideally it would be cool if I didn't have the wrapper classes at all and 
if I could somehow say "give me the conference for an artifact" without 
having to go through the intermediary. I'm assuming that I can't do that.

Even this doesn't work though because the OPSConference class uses the
ConferencePeer's doSelect (which returns a Conference) and then tries to
cast it to an OPSConference and that fails. I am currently using the
classes to get the id's and then looking up the Conference using

I read the inheritance guide, but the table part of the schema is just an 

Is it possible for torque classes to inherit from each other across 
schemas? If so, what am I missing?

Will Holcomb

View raw message