db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damien SAUVAGEOT" <dsauvag...@omnikles.com>
Subject TR: JDBC task. om classes don't compile
Date Tue, 09 Mar 2004 08:55:22 GMT
The dev list was probably more appropriate for this kind of issue.

-----Message d'origine-----
De : Damien SAUVAGEOT 
Envoyé : lundi 8 mars 2004 15:03
À : Turbine Torque Users List (E-mail)
Objet : JDBC task. om classes don't compile

using jdbc task, I get column like this :

<column default="nextval('public.&quot;PROCEDURE_idprocedure_seq&quot;'::text)"
name="idprocedure" primaryKey="true" required="true" type="INTEGER"/>

The om task generates then compilation error with the lines :
/** The value for the idprocedure field */
private int idprocedure = nextval('public."PROCEDURE_idprocedure_seq"'::text);



Previously, I was writing the schema.xml on my own using :
<column name="idprocedure" type="INTEGER" required="true" primaryKey="true" autoIncrement="true"/>
<id-method-parameter value="procedures_idprocedure_seq"/>

wich was generating BaseProcedure without errors.

watching TorqueJDBCTransformTask, I guess there is an issue generating the columns. Default
values are always set even if the value is something like nextval.... I guess in that case,
the default="" should be replaced by autoIncrement="true" and <id-method-parameter...>

According to TorqueJDBCTransformTask, I believe that the XML generation does not depend on
the database type. 

Am I doing something wrong?


if (defValue != null) 
	// trim out parens & quotes out of def value.
	// makes sense for MSSQL. not sure about others.
	if (defValue.startsWith("(") && defValue.endsWith(")"))
		defValue = defValue.substring(1, defValue.length() - 1);
	if (defValue.startsWith("'") && defValue.endsWith("'"))
		defValue = defValue.substring(1, defValue.length() - 1);
	column.setAttribute("default", defValue);

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message