Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 72707 invoked from network); 11 Oct 2007 21:11:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2007 21:11:07 -0000 Received: (qmail 61599 invoked by uid 500); 11 Oct 2007 21:10:55 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 61578 invoked by uid 500); 11 Oct 2007 21:10:55 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 61567 invoked by uid 99); 11 Oct 2007 21:10:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2007 14:10:55 -0700 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS,URIBL_RHS_DOB X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of softmasters@gmail.com designates 64.233.162.224 as permitted sender) Received: from [64.233.162.224] (HELO nz-out-0506.google.com) (64.233.162.224) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2007 21:10:55 +0000 Received: by nz-out-0506.google.com with SMTP id m7so505880nzf for ; Thu, 11 Oct 2007 14:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; bh=5zf7vbfk8gV+GvQHMYQaLaTdurRUwm+3H58LZ4AkB5Q=; b=Agg1C5ubTWm6Ta8vuJkQxCkPlxwaRADxkZiDLeWl/cMznPBPQKiz+jE+4GJUuNCqy3cbhaWn1xPPLEHnDavq43dbQWICISZdJpjhBk+b+p14MdmCd27ilj2c7HZFDH+SLsrv/2j5g0CPwE6mtfaWLB4/K2kZCC+fKUyjJqnar2Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=ToVLdtWpsqNna7FOwMYFXjiG60Ie+Fv0XzB7Q/hq+5iH0qpUKipq8lK1Es33IT7zC6uuH3+b5CiCu4YnwHtxkLF2bHVlKN+1RR+EoWDcMk7AJHBd+RuLtk6CVpnq9xKFQPAu1I72F8wSLNkFHedMF+t+n4vVrC8szty7Qf9VGf0= Received: by 10.115.14.1 with SMTP id r1mr2659490wai.1192137031394; Thu, 11 Oct 2007 14:10:31 -0700 (PDT) Received: by 10.114.132.16 with HTTP; Thu, 11 Oct 2007 14:10:31 -0700 (PDT) Message-ID: Date: Thu, 11 Oct 2007 23:10:31 +0200 From: "Alex Laudani - Softmasters" Reply-To: alex@softmasters.net Sender: softmasters@gmail.com To: "Thomas Fischer" Subject: Re: problem with om classes Cc: "Apache Torque Users List" In-Reply-To: <20071011133846.K63685@minotaur.apache.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18279_18177621.1192137031388" References: <20071011133846.K63685@minotaur.apache.org> X-Google-Sender-Auth: 14102add906fac3a X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_18279_18177621.1192137031388 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Removing the empty interface solves the problem. The issue is caused by devaki-nextobjects which creates a wrong schema.xmland adds the interface="". Thank you Regards On 10/11/07, Thomas Fischer wrote: > > Hm, you have defined the foreign key twice: > > > > > > perhaps removing one of the references helps ? > > It should not be necessary to define an interface. Can you remove the > empty interface and see what happens ? > > Thomas > > On Tue, 9 Oct 2007, Alex Laudani - Softmasters wrote: > > > Hello, > > I have problems with generating torque classes with torque generator. > > The generator is invoked using ant build from devaki nextobjects. > > Below are my schema.xml file and my build.properties. > > The generated BaseLibriPeer has the following problem: > > at line 825 it shows: > > > > boolean newObject = true; > > for (int j = 0; j < results.size(); j++) > > { > > Libri temp_obj1 = (Libri)results.get(j); > > Autori temp_obj2 = (Autori)temp_obj1.get(); > > if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey > ())) > > { > > newObject = false; > > temp_obj2.addLibri(obj1); > > break; > > } > > } > > > > The problem is that > > Autori temp_obj2 = (Autori)temp_obj1.get(); > > should be > > Autori temp_obj2 = (Autori)temp_obj1.getAutori(); > > and so it gives an error at compile time because the get() method does > not > > exist in Libri. > > I've tried to look at om/Peer.vm template and I can see the a > > $joinTable.Interface is involved. I think that the value for > > $table.Interface is not defined. How can I define it? > > Thank you > > Regards > > > > schema.xml > > > > > > > package="org.devaki.nextobjects.models" baseClass=" > > org.apache.torque.om.BaseObject" basePeer=" > org.apache.torque.util.BasePeer" > > defaultJavaNamingMethod="underscore" heavyIndexing="false"> > > > > > interface="" javaNamingMethod="nochange" heavyIndexing="false" > > description=""> > > > > > required="true" type="INTEGER" javaType="object" > > javaNamingMethod="javaname"/> > > type="VARCHAR" > > javaType="object" size="255" javaNamingMethod="javaname"/> > > > >
> > > interface="" javaNamingMethod="nochange" heavyIndexing="false" > > description=""> > > > > > required="true" type="INTEGER" javaType="object" > > javaNamingMethod="javaname"/> > > > javaType="object" size="255" javaNamingMethod="javaname"/> > > > type="INTEGER" javaType="object" javaNamingMethod="javaname"/> > > > > onDelete="none"> > > > > > > > > > >
> >
> > > > build.properties: > > #--- properties for Torque build --- > > #Tue Oct 09 01:11:11 CEST 2007 > > project=project1 > > complexObjectModel=true > > databaseUrl=jdbc\:postgresql\://127.0.0.1/project1 > > IntakeControlTemplate=intake/Control.vm > > ServiceControlTemplate=service/Control.vm > > torque.database.schema=public > > idTableControlTemplate=sql/id-table/Control.vm > > addSaveMethod=true > > createDatabaseUrl=jdbc\:postgresql\://127.0.0.1/template1 > > basePrefix=Base > > addGetByNameMethod=true > > DataSQLControlTemplate=sql/load/Control.vm > > configDir=./config > > databaseHost=127.0.0.1 > > databaseDriver=org.postgresql.Driver > > OMControlTemplate=om/Control.vm > > targetPackage=org.devaki.nextobjects.models > > database=postgresql > > documentationFormat=html > > DataDumpControlTemplate=data/dump/Control.vm > > DocControlTemplate=doc/Control.vm > > addIntakeRetrievable=true > > buildDatabaseUrl=jdbc\:postgresql\://127.0.0.1/project1 > > DataDTDControlTemplate=data/Control.vm > > SQLControlTemplate=sql/base/Control.vm > > userManagers=false > > sameJavaName=false > > templatePath=templates > > torque.home=C\:\\Documents and > Settings\\Alex\\devaki-nextobjects\\torque- > > gen-3.1 > > databaseUser=devaki > > addTimeStamp=true > > outputDirectory=src > > databasePassword= > > schemaDirectory=schema > > > -- ------------------------ Alex Laudani Softmasters - Technology solutions Via Dante 2/26 16121 Genova Italy Phone: +390108936161 GSM: +393384531234 http://www.softmasters.net ----------------------- ------=_Part_18279_18177621.1192137031388--