db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David_Solbach/MR/de/Dade...@dadebehring.com
Subject Foreign-Key Problem
Date Thu, 16 Oct 2003 09:27:41 GMT
Hi,

I have the following Problem with my turbine-project (fcar):

in <WEB-INF/conf/turbine-schema.xml> I have:

---
<Database name=turbine>
...
<table name="TURBINE_USER" idMethod="idbroker">
    <column name="USER_ID" required="true" primaryKey="true" 
type="INTEGER"/>
    <column name="LOGIN_NAME" required="true" size="32" type="VARCHAR"/>
    <column name="PASSWORD_VALUE" required="true" size="32" 
type="VARCHAR"/>
    <column name="FIRST_NAME" required="true" size="99" type="VARCHAR"/>
    <column name="LAST_NAME" required="true" size="99" type="VARCHAR"/>
    <column name="EMAIL" size="99" type="VARCHAR"/>
    <column name="CONFIRM_VALUE" size="99" type="VARCHAR"/>
    <column name="MODIFIED" type="TIMESTAMP"/>
    <column name="CREATED" type="TIMESTAMP"/>
    <column name="LAST_LOGIN" type="TIMESTAMP"/>
    <column name="OBJECTDATA" type="VARBINARY"/>

    <unique>
        <unique-column name="LOGIN_NAME"/>
    </unique>

</table>
...
----

and in <fcar-schema.xml> :

---
<database name="fcar">
  <table name="FCAR_ADDRESS" idMethod="idbroker">
    <column name="ADDRESS_ID" required="true" primaryKey="true" 
type="INTEGER"/>
    <column name="USER_ID" required="true" type="INTEGER"/>
    <column name="STREET" size="255" type="VARCHAR"/>
    <column name="NR" type="INTEGER"/>
    <column name="CITY" size="255" type="VARCHAR"/>
    <column name="PLZ" type="INTEGER"/>

   <foreign-key foreignTable="TURBINE_USER">
      <reference local="USER_ID" foreign="USER_ID" />
    </foreign-key> 

  </table>
</database>
---

ant init now tells me:

---
...
sql-classpath:
[torque-sql] Using contextProperties file: 
/opt/tdk-2.2/webapps/fcar/WEB-INF/build/build.properties
[torque-sql] Using classpath
[torque-sql] Generating to file 
/opt/tdk-2.2/webapps/fcar/WEB-INF/src/sql/report.fcar.sql.generation
[torque-sql] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package
[torque-sql] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package
[torque-sql] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package
!! --> [torque-sql] ERROR!! Attempt to set foreign key to nonexistent 
table, TURBINE_USER! 

BUILD FAILED
file:/opt/tdk-2.2/webapps/fcar/WEB-INF/build/build-torque.xml:198: 
Generation failed. For more information consult the velocity log, or 
invoke ant with the -debug flag.
...
---

Of course, it's another Database-name for Torque, but isn't that kind of 
cross referencing possible, or is there a good workaround? Because I'd 
very much like to use Turbine's user/permission management capabilities 
directly in my application, where I might have a lot of tables, that need 
FK's to entries in the turbine-tables.

Thank you,

David
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message