db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damien SAUVAGEOT" <dsauvag...@omnikles.com>
Subject RE: JDBC task. om classes don't compile
Date Wed, 10 Mar 2004 15:57:47 GMT
As I didn't get any answer, I modified the TorqueJDBCTransformTask in order to generate autoincrement
instead of default="nextval...".
Here is the patch. I am not sure, I have done it the right way as it is my first patch.

Damien


-----Message d'origine-----
De : Damien SAUVAGEOT 
Envoyé : mardi 9 mars 2004 09:55
À : Turbine Torque Developers List (E-mail)
Objet : TR: JDBC task. om classes don't compile


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

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


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


Mime
View raw message