Bug report sent directly to me. @Vadim: If you have problems regarding Torque, please use the mailing lists and do not send emails directly to the developers. Thanks a lot.
Thomas "Pesochinskiy, Vadim \(MSCIBARRA\)" <[EMAIL PROTECTED]> schrieb am 02.03.2006 23:28:53: > Hello! > > I am trying to upgrade from version 3.1.1 to 3.2. Here is a fragment > of Object.vm, that I am having trouble with. > > #set ($currentPackage = $table.Database.Package) > #foreach ($col in $table.Columns) > #if ($col.isForeignKey()) > #set ($fkPackage = $table.Database.getTable($col. > RelatedTableName).getPackage()) > #if (!$fkPackage.equals($currentPackage) ) > import ${fkPackage}.${table.Database.getTable($col. > RelatedTableName).JavaName}; > import ${fkPackage}.${table.Database.getTable($col. > RelatedTableName).JavaName}Peer; > #end > #end > #end > > The problem seems to be with getPackage() method, which seems to > return null and invalid import statements are inserted. E.g. > > import ${fkPackage}.MyTable; > import ${fkPackage}.MyTablePeer; > I can resolve this issue, by changing the if condition to check if > fkPackage is null. E.g. > #if ($fkPackage && !$fkPackage.equals($currentPackage) ) > However, I want to avoid changing the templates, because it turns > into maintenance trouble (we have quite a few now, which I am > working to remove). Besides, it should have worked for you, but > somehow it does not work for me. One of the things I suspect is the > fact that our ant build file is old and it uses following syntax, > which I cannot find in the standard build-torque.xml. Any help will > be greatly appreciated. > <target name="torque6_dist" depends="torque6_dist_check" > unless="torque6_dist.uptodate" description="generate om classes if needed"> > <antcall target="om-clean"/> > <torque-om contextProperties="${torque.build.properties}" > controlTemplate="${OMControlTemplate}" > outputDirectory="${torque.output.dir}" > outputFile="${torque.report}" targetDatabase="${torque.database}" > templatePath="templates" useClasspath="false" > > <fileset dir= "schema" includes="*-schema.xml"/> > </torque-om> > <attrib readonly="true"> > <fileset dir="${bdo.src}/com/barra/cp/bdo/torque" > includes="Base*.java"/> > <fileset dir="${bdo.src}/com/barra/cp/bdo/torque/map"/> > </attrib> > </target> > Thanks, > Vadim. > > > > > > NOTICE: If received in error, please destroy and notify sender. > Sender does not waive confidentiality or privilege, and use is prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]