db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damien SAUVAGEOT" <dsauvag...@omnikles.com>
Subject JDBC task. om classes don't compile
Date Mon, 08 Mar 2004 14:02:55 GMT
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);

and

copyObj.setIdprocedure(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?

Damien


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


Mime
View raw message