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 foreign-key problems
Date Sat, 29 Mar 2003 17:05:16 GMT
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>



Mime
View raw message