db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoit Joly (LMC)" <Benoit.J...@ericsson.ca>
Subject RE: OM compile failure: TABLE_NAME defined twice
Date Fri, 25 Apr 2003 14:57:33 GMT
Hi Graham, 

there is a few name you can't take because of the way torque generate the om files.

TABLE_NAME and DATABASE_NAME are already used by torque to define the table and database name
in the BaseSomethingPeer generated class. 
You must use different column name than these two when defining your own tables.

But here, you are generating om classes for the ID_TABLE which is not necessary and something
you need to avoid because of the TABLE_NAME column. You must not generate om classes for the
file id-table-schema.xml, only sql files.

Benoit

-----Original Message-----
From: Graham Leggett [mailto:minfrin@sharp.fm]
Sent: Friday, April 25, 2003 10:45 AM
To: Turbine Torque Users List
Subject: OM compile failure: TABLE_NAME defined twice


Hi all,

Torque generates my OM classes, but they fail to compile like so:

java:compile:
     [javac] Since fork is true, ignoring compiler setting.
     [javac] Compiling 169 source files to 
/home/sam/minfrin/src/fma/patricia-db/target/classes
     [javac] Since fork is true, ignoring compiler setting.
     [javac] 
/home/sam/minfrin/src/fma/patricia-db/src/java/za/co/fma/patricia/database/om/BaseIdTablePeer.java:64:

TABLE_NAME is already defined in 
za.co.fma.patricia.database.om.BaseIdTablePeer
     [javac]     public static final String TABLE_NAME;
     [javac]                                ^
     [javac] 
/home/sam/minfrin/src/fma/patricia-db/src/java/za/co/fma/patricia/database/om/BaseIdTablePeer.java:73:

cannot assign a value to final variable TABLE_NAME
     [javac]     TABLE_NAME = "ID_TABLE.TABLE_NAME";
     [javac]     ^
     [javac] 2 errors

I suspect the problem is related to the following bit of my database 
schema definition:

   <table name="ID_TABLE">
     <column name="ID_TABLE_ID" required="true" primaryKey="true" 
type="INTEGER"/>
     <column name="TABLE_NAME" required="true" size="255" type="VARCHAR"/>
     <column name="NEXT_ID" type="INTEGER"/>
     <column name="QUANTITY" type="INTEGER"/>

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

   </table>

The above table is defined inside my database-schema.xml file - is this 
the correct thing to do? The docs are a little vague on how the whole 
auto sequence generation works, and exactly how you set it up.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."


---------------------------------------------------------------------
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