You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Don O'Leary <do...@delads.com> on 2004/02/20 20:08:25 UTC

Problems integrating Torque into existing environment

Hi

I am new to this forum.
I have run through the tutorial for Torque and everything worked great. Very powerful, and looking forward to integrating this functionality into my existing environment.

In doing so, I have run into the following problems, building the tutorial example in my environment.


I am including "build-torque.xml" from my existing build.xml file, so I have had to remove the outer <project> tags. Seems to work fine.
I have run into the following problems.

Problem 1
When running "ant id-table-init-sql" I get the following exception 
BUILD FAILED
file:./antinclude/build-torque.xml:399: The <torque-sql> task doesn't support the "useclasspath" attribute.

I can see that this useClasspath attribute is to allow the dynamic lookup of templates from the classpath, so torque can be used without extracting the jar.
I can live without this functionality for now, so when I remove the useClasspath from my ant tasks, I get past this point.

Problem 2
The second problem is when I run the "ant insert-sql"

insert-sql:
[torque-sql-exec] Our new url -> jdbc:mysql://127.0.0.1/bookstore
[torque-sql-exec] Executing file: C:\cvslib\qa\src\sql\id-table-schema.sql
[torque-sql-exec] Executing file: C:\cvslib\qa\src\sql\bookstore-schema.sql
[torque-sql-exec] Executing file: C:\cvslib\qa\src\sql\bookstore-schema-idtable-
init.sql
[torque-sql-exec] Failed to execute: insert into ID_TABLE (id_table_id, table_na
me, next_id, quantity) VALUES ($initialID, 'book', $initialIDValue, $initialIDSt
ep)
[torque-sql-exec] java.sql.SQLException: Column not found,  message from server:
 "Unknown column '$initialID' in 'field list'"
[torque-sql-exec] Failed to execute: insert into ID_TABLE (id_table_id, table_na
me, next_id, quantity) VALUES ($initialID, 'publisher', $initialIDValue, $initia
lIDStep)
[torque-sql-exec] java.sql.SQLException: Column not found,  message from server:
 "Unknown column '$initialID' in 'field list'"
[torque-sql-exec] Failed to execute: insert into ID_TABLE (id_table_id, table_na
me, next_id, quantity) VALUES ($initialID, 'author', $initialIDValue, $initialID
Step)
[torque-sql-exec] java.sql.SQLException: Column not found,  message from server:
 "Unknown column '$initialID' in 'field list'"
[torque-sql-exec] 8 of 11 SQL statements executed successfully

BUILD SUCCESSFUL
Total time: 2 seconds



The database looks like it was created successfully, but I am worried I will run into problems later on. I don't really want to be chasing my tail with issues if this is a configuration issue integrating torque into an existing environment.

Any help would be very much appreciated.
Cheers

Don




Re: Object.vm and ObjectWithManager.vm with Java Primitive in PrimaryKey

Posted by Scott Eade <se...@backstagetech.com.au>.
Xavier Maysonnave wrote:

> Code generation using Torque Generator Object Mapping 3.1.
>
> When I compiled the generated code I got several errors.
>
> I tested with useManagers = true and useManager = false
>
> I analysed the Object.vm template and the ObjectWithManagerTemplate.vm.
>
> The compile error occured in java primitive used in Primary Keys.
>
> Example code error :
>     setCountry(0);
> when country is a short, the ideal code could be:
>     setCountry((short) 0);
>
> Object.vm line 269
>     set${column.JavaName}($coldefval);
> could be
>     set${column.JavaName}(($column.JavaNative) $coldefval);
>
> Object.vm line 1412
>     copyObj.set${col.JavaName}($coldefval);
> could be
>     copyObj.set${col.JavaName}(($col.JavaNative) $coldefval);
>
> ObjectWithManager.vm line 270
>     set${column.JavaName}($coldefval);
> could be
>     set${column.JavaName}(($column.JavaNative) $coldefval);
>
> ObjectWithManager.vm line 1381
>     copyObj.set${col.JavaName}($coldefval);
> could be
>     copyObj.set${col.JavaName}(($col.JavaNative) $coldefval);

This was addressed by Martin as part of TRQS97.

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au


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


Object.vm and ObjectWithManager.vm with Java Primitive in PrimaryKey

Posted by Xavier Maysonnave <xa...@omondo.com>.
Hi,

Code generation using Torque Generator Object Mapping 3.1.

When I compiled the generated code I got several errors.

I tested with useManagers = true and useManager = false

I analysed the Object.vm template and the ObjectWithManagerTemplate.vm.

The compile error occured in java primitive used in Primary Keys.

Example code error :
	setCountry(0);
when country is a short, the ideal code could be:
	setCountry((short) 0);

Object.vm line 269
	set${column.JavaName}($coldefval);
could be
	set${column.JavaName}(($column.JavaNative) $coldefval);

Object.vm line 1412
	copyObj.set${col.JavaName}($coldefval);
could be
	copyObj.set${col.JavaName}(($col.JavaNative) $coldefval);

ObjectWithManager.vm line 270
	set${column.JavaName}($coldefval);
could be
	set${column.JavaName}(($column.JavaNative) $coldefval);

ObjectWithManager.vm line 1381
	copyObj.set${col.JavaName}($coldefval);
could be
	copyObj.set${col.JavaName}(($col.JavaNative) $coldefval);

Regards.



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