Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 90740 invoked from network); 6 Mar 2004 22:57:16 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Mar 2004 22:57:16 -0000 Received: (qmail 76511 invoked by uid 500); 6 Mar 2004 22:57:00 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 76497 invoked by uid 500); 6 Mar 2004 22:57:00 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 76482 invoked from network); 6 Mar 2004 22:57:00 -0000 Received: from unknown (HELO terragate.net) (217.160.133.107) by daedalus.apache.org with SMTP; 6 Mar 2004 22:57:00 -0000 Received: by terragate.net (Postfix, from userid 1016) id 5A325142A0; Sat, 6 Mar 2004 23:57:06 +0100 (CET) Received: from terragate.net (dsl-082-083-110-164.arcor-ip.net [82.83.110.164]) by terragate.net (Postfix) with ESMTP id 4E92F1429F for ; Sat, 6 Mar 2004 23:57:05 +0100 (CET) Message-ID: <404A58B4.8040909@terragate.net> Date: Sun, 07 Mar 2004 00:03:16 +0100 From: =?ISO-8859-1?Q?Tomasz_Dre=DFler?= User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: How do I use the feature onUpdate="cascade" with Torque? References: <20040304193355.AE72F142D8@terragate.net> In-Reply-To: <20040304193355.AE72F142D8@terragate.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on terragate.net X-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=ham version=2.60 X-Spam-Level: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Luca Zappa! I know, with your solution my problem will disappeare. But this meens a lot of work for me ... Thank you for reply! Greetings Tomek Luca Zappa wrote: >If you need to update the serverAdress in the 'server' table I think it's a >better solution if you don't use this field as a primary key. >You can add a SERVER_ID for primary key, and then you'll be able to update >serverAdress and no changes are needed in the 'file' table. > >[-------------------- schema.xml ---------------------------] > > required="true" > primaryKey="true" > type="INTEGER" > autoIncrement="true" /> > required="true" type="VARCHAR" size="255" > description="Server Adresse" /> > required="true" type="VARCHAR" > size="128" description="Server Name" />
> > > type="INTEGER" autoIncrement="true" > description="File ID" /> > type="INTEGER" > description="FK Server ID" /> > type="LONGVARCHAR" > description="File Pfad" /> > type="VARCHAR" size="255" > description="File Name" /> > > > >
> > >-----Original Message----- >From: Tomasz Dre�ler [mailto:tdress@terragate.net] >Sent: Thursday, March 04, 2004 5:02 PM >To: Apache Torque Users List >Subject: How do I use the feature onUpdate="cascade" with Torque? > >Hi! >I have the tables 'server' and 'file'. >How can I update the 'server.serveradress' (PK) and 'file.serverAdress' >(FK) with Torque? >The attribute 'file.serverAdress' have the flag onUpdate="cascade". > >I try folowing: > Criteria crit = new Criteria(); > crit.add(ServerPeer.SERVERADRESS, "oldServerAdress"); > List v = ServerPeer.doSelect(crit) > > Iterator iteratorServer = v.iterator(); > Server server; > if(iteratorServer.hasNext()){ > server = (Server) iteratorServer.next(); > } > > server.setServeradress("newServerAdress"); > > ServerPeer.doUpdate(server); // don't work > server.save(); // don't work, too > >Thanks for your attention > >Greetings >Tomek > >[------------------------- schema.xml >--------------------------------------] > > required="true" type="VARCHAR" size="255" > description="Server Adresse" /> > required="true" type="VARCHAR" > size="128" description="Server Name" />
> > > type="INTEGER" autoIncrement="true" > description="File ID" /> > type="VARCHAR" size="255" > description="FK Server Adresse" /> > type="LONGVARCHAR" > description="File Pfad" /> > type="VARCHAR" size="255" > description="File Name" /> > > > >
> > > > >--------------------------------------------------------------------- >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-user-unsubscribe@db.apache.org >For additional commands, e-mail: torque-user-help@db.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org