db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Krabbenbos <jan.krabben...@planet.nl>
Subject OM generation problem
Date Thu, 02 Oct 2003 07:36:36 GMT
Hi,

I new to torque and torque-gen, so I now am trying to find out how I can use 
and implement it (I'm using 3.1). I have an existing MySQL database, which I 
want use. With torque-gen and the jdbc action I generated the schema and the 
object model. When I now compile the generated java sources, it returns with 
the error:

club.java:41: illegal start of expression
    [javac]     private long club_id = ;

There is no value inserted between '=' and ';' so therefor it can not be 
compiled. I checked what could be the problem, and it seems to be the auto 
increment in the table for club_id. With the autoincrement it generates the 
following schema for the table 'club':

<table javaName="club" name="club">
	<column default="" javaName="club_id" name="club_id"
		primaryKey="true" required="true" type="BIGINT"/>
	<column default="" javaName="name" name="name" size="100" type="VARCHAR"/>
	<column default="" javaName="location" name="location"
		size="100" type="VARCHAR"/>
	<column default="" javaName="description" name="description"
		size="255" type="VARCHAR"/>
	<column default="" javaName="changed" name="changed" type="TIMESTAMP"/>
</table>

After changing the autoincrement in the MySQL to no for 'club_id' it generates 
the following schema and the object model generated compiles!?!

<table javaName="club" name="club">
	<column default="0" javaName="club_id" name="club_id"
		primaryKey="true" required="true" type="BIGINT"/>
	<column default="" javaName="name" name="name" size="100" type="VARCHAR"/>
	<column default="" javaName="location" name="location"
		size="100" type="VARCHAR"/>
	<column default="" javaName="description" name="description"
		size="255" type="VARCHAR"/>
	<column default="" javaName="changed" name="changed" type="TIMESTAMP"/>
</table>

The difference is in the default-tag of the column 'club_id'. With the 
autoincrement it is  empty and without the autoincrement it is 0. Can anybody 
tell me if this is a configuration problem or a bug?
-- 
Met vriendelijke groet,

Jan Krabbenbos

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