Can I join to something that is not the PK?

TABLE SCHOOL
int school_id PK
int college_id

TABLE PROFILE
int profile_id PK
int school_id FK to SCHOOL.school_id

TABLE INFO
int info_id PK
int college_id FK to SCHOOL.college_id


Can this be done? It doesn't seem like it. When I try either "super" or a reference-descriptor foreign-key it always points to the PK of the referred table. I find this weird since Torque doesn't work this way. When I setup the torque-schema.xml file you see something like this:

<table name="INFO" javaName="Info" idMethod="none">
<column name="info_id" required="true" primaryKey="true" type="INTEGER" autoIncrement="true"/>
<column name="college_id" required="true" type="INTEGER"/>
<foreign-key foreignTable="SCHOOL">
<reference local="college_id" foreign="college_id"/>
</foreign-key>
</table>


What I like about that setup is that you can designate the local column
and the foreign column.  Not so with OJB.  Am I just not seeing where it
gets set?  This would be huge if it worked.

Oh, and all of the other JOIN questions that I had have been answered.  The
latest from CVS made the difference, thanks so much for the tips.


Charlie




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



Reply via email to