Re: Starting trouble
As the error output says, look in velocity.log -- an error occurred while rendering Velocity templates. rakesh nair wrote: Hi, I am a newbie for Torque. Can anybody help me in getting rid of this problem. Please help me thanks in advance rakesh sql-template: [echo] loading templates from templates [torque-sql] Using contextProperties file: F:\torque\torque-gen-3.1\torque-gen-3 .1\build.properties [torque-sql] Generating to file F:\torque\torque-gen-3.1\torque-gen-3.1\src\sql\ report.bookstore.sql.generation [torque-sql] log4j:ERROR Could not find value for key log4j.appender.org.apache. torque.engine [torque-sql] log4j:ERROR Could not instantiate appender named "org.apache.torque .engine". [torque-sql] 2004-03-04 08:59:52,547 [main] INFO org.apache.torque.engine.datab ase.transform.XmlToAppData - Parsing file: 'id-table-schema.xml' [torque-sql] 2004-03-04 08:59:52,562 [main] INFO org.apache.torque.engine.datab ase.transform.DTDResolver - Resolver: used database.dtd from 'org.apache.torque. engine.database.transform' package BUILD FAILED file:F:/torque/torque-gen-3.1/torque-gen-3.1/build-torque.xml:207: Exception thr own by 'generator.parse'. For more information consult the velocity log, or invo ke ant with the -debug flag. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating XXX-schema.xml from existing DB
It looks like your Log4J-based log file is misconfigured. Make sure that log4j.properties is available to your application. It should probably look something like this: log4j.rootLogger = INFO, torque-gen # # Turbine goes into Turbine Log # log4j.category.org.apache.torque-gen = DEBUG, org.apache.torque.engine log4j.additivity.org.apache.torque-gen = false log4j.appender.torque-gen = org.apache.log4j.ConsoleAppender log4j.appender.torque-gen.layout = org.apache.log4j.PatternLayout log4j.appender.torque-gen.layout.conversionPattern = %d [%t] %-5p %c - %m%n (Taken from src/generator/src/conf/log4j.properties.) Sheng Guo wrote: Hello, I have a similar problem. I wrote a sql file, and used it to generate the tables in the PostgreSQL database. And now I want to generate a project-schema.xml with the exiting .sql file, but it failed. In the build-torque.xml I have the following code: and I tried ant -f build-torque.xml sql2xml , but there was alway a problem: C:\SEP\gogol\components\cnt>ant -f build-torque.xml sql2xml Buildfile: build-torque.xml sql2xml: [torque-sql-transform] Parsing SQL Schema [torque-sql-transform] log4j:ERROR Could not find value for key log4j.appender.o rg.apache.torque.engine [torque-sql-transform] log4j:ERROR Could not instantiate appender named "org.apa che.torque.engine". After that the programm stopped. What is wrong here? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: db-torque/src/generator/src/templates/sql/base/hypersonic table.vm
dlr 2004/04/17 14:19:03 Modified:src/generator/src/templates/sql/base/hypersonic Tag: TORQUE_3_1_BRANCH table.vm Log: * src/generator/src/templates/sql/base/hypersonic/table.vm Backport CVS rev 1.4, which contains the Hypersonic template fix from Serge Huber. Branch: TORQUE_3_1_BRANCH Revision ChangesPath No revision No revision 1.2.2.1 +1 -1 db-torque/src/generator/src/templates/sql/base/hypersonic/table.vm Index: table.vm === RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/hypersonic/table.vm,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -u -r1.2 -r1.2.2.1 --- table.vm 29 Jun 2003 14:30:02 - 1.2 +++ table.vm 17 Apr 2004 21:19:03 - 1.2.2.1 @@ -2,7 +2,7 @@ - -- $table.Name - -##$generator.parse("$basepath/drop.vm", "", "table", $tbl) +$generator.parse("$basepath/drop.vm", "", "table", $tbl) CREATE TABLE $table.Name ( #set ( $cols = $generator.parse("$basepath/columns.vm", "", "table", $tbl) ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [PATCH] templates/om/Object.vm
Luca Zappa wrote: Hi, here's a simple patch to templates/om/Object.vm that fixes a compile error with j2sdk1.5.0 in method toString. The error was in the sequential call of append method of StringBuffer: "the type AbstractStringBuilder is not visible" Index: Object.vm === RCS file: /home/cvspublic/db-torque/src/generator/src/templates/om/Object.vm,v retrieving revision 1.12 diff -u -r1.12 Object.vm --- Object.vm 21 Jan 2004 23:05:57 - 1.12 +++ Object.vm 8 Apr 2004 12:17:37 - @@ -1529,9 +1529,9 @@ StringBuffer str = new StringBuffer(); str.append("$table.JavaName:\n"); #foreach ($col in $table.Columns) -str.append("$col.JavaName = ") - .append(get${col.JavaName}()) - .append("\n"); +str.append("$col.JavaName = "); +str.append(get${col.JavaName}()); +str.append("\n"); #end return(str.toString()); } Commited in CVS rev 1.13 of Object.vm. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: db-torque/src/generator/src/templates/om Object.vm
dlr 2004/04/17 14:08:09 Modified:src/generator/src/templates/om Object.vm Log: * src/generator/src/templates/om/Object.vm Work around "the type AbstractStringBuilder is not visible" error reported by Luca Zappa to be triggered by sequential calls to the append() method of StringBuffer using JSDK 1.5.0. Sounds like a problem with 1.5.0's compiler, but it costs us nothing to avoid code which triggers it. Revision ChangesPath 1.13 +3 -3 db-torque/src/generator/src/templates/om/Object.vm Index: Object.vm === RCS file: /home/cvs/db-torque/src/generator/src/templates/om/Object.vm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -u -r1.12 -r1.13 --- Object.vm 21 Jan 2004 23:05:57 - 1.12 +++ Object.vm 17 Apr 2004 21:08:09 - 1.13 @@ -1529,9 +1529,9 @@ StringBuffer str = new StringBuffer(); str.append("$table.JavaName:\n"); #foreach ($col in $table.Columns) -str.append("$col.JavaName = ") - .append(get${col.JavaName}()) - .append("\n"); +str.append("$col.JavaName = "); +str.append(get${col.JavaName}()); +str.append('\n'); #end return(str.toString()); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[DB Torque Wiki] Updated: HarderTorqueFaq
Date: 2004-04-17T13:14:04 Editor: SyncMaster <[EMAIL PROTECTED]> Wiki: DB Torque Wiki Page: HarderTorqueFaq URL: http://wiki.apache.org/db-torque/HarderTorqueFaq no comment Change Log: -- @@ -34,3 +34,9 @@ --- Torque is ok with multi-column primary keys (I've only tried it in 3.1). In my case it was two CHAR fields. --Gary S. + +--- +Yes, you can have a multi-column primary-key, BUT it does not work, if you need one column of this PK as autoincrement. And this is my problem. The Torque engine looks up the new key from the sequence and writes it into the System.out/Log-File, but it does not put it into the PK-field, where I need the value. +Would be nice, if someone had a solution for this. I found the same problem in another forum, but there was also no answer to this question. + +SyncMaster - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]