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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





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



Reply via email to