db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Wiesner <step...@stephan-wiesner.de>
Subject Re: foreign-key problems
Date Sat, 29 Mar 2003 17:50:46 GMT
Okay, found the problem. Have to define it the other way round...

Stephan

Stephan Wiesner wrote:

> Hi list, I have a problem with foreign-key elements. Below is my tiny 
> database definition and I can generate the SQL, if I remove the 
> foreign-key element. With it, I get a nullpointer exception, though.
> Can anybody, please, enlighten me?
>
> java.lang.NullPointerException
>        at 
> org.apache.torque.engine.database.model.Database.doFinalInitialization(Database.java:444)

>
>
>
> <database
>  name="immorate"
>  defaultIdMethod="idbroker">
>
>  <table name="customer" description="Customer of Bank">
>    <column
>      name="c_id"
>      required="true"
>      primaryKey="true"
>      type="INTEGER"
>      description="Customer Id"/>
>    <column
>      name="lastname"
>      required="true"
>      type="VARCHAR"
>      size="100"
>      description=""/>
>
>  </table>
>
>
>  <table name="account" description="Bank account">
>    <column
>      name="accountnumber"
>      required="true"
>      primaryKey="true"
>      type="INTEGER"
>      description="Account number"/>
>
>    <foreign-key foreignTable="customer"
>      >
>      <reference
>        local="c_id"
>        foreign="c_id"/>
>    </foreign-key>
>  </table>  </database>
>
>
>
> ---------------------------------------------------------------------
> 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