Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 46791 invoked from network); 8 Dec 2004 14:27:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Dec 2004 14:27:18 -0000 Received: (qmail 82929 invoked by uid 500); 8 Dec 2004 14:27:14 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 82911 invoked by uid 500); 8 Dec 2004 14:27:14 -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 82896 invoked by uid 99); 8 Dec 2004 14:27:14 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.126.173) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 08 Dec 2004 06:27:12 -0800 Received: from [212.227.126.155] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Cc2mc-0007R7-00 for torque-user@db.apache.org; Wed, 08 Dec 2004 15:27:10 +0100 Received: from [217.7.104.70] (helo=ex1.GT.local) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1Cc2mc-0006yG-00 for torque-user@db.apache.org; Wed, 08 Dec 2004 15:27:10 +0100 Subject: AW: Saving associated objects MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 8 Dec 2004 15:22:24 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Content-class: urn:content-classes:message Message-ID: <9B336061971E8B4E8A324C63BEB2D2EE8C0CB7@ex1.GT.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Saving associated objects Thread-Index: AcTdL0tkiCqXtx+jQB+q/fmDH/rnVAAAeqbg From: "Vitzethum, Daniel" To: "Apache Torque Users List" X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:08b64d493f559a3060db53eba29a9aeb X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Thomas, > I am not sure if I understand the question. you did ;-) > (...) > If you have a real 1:1 behaviour, you can put the foreign key on the > other side, ... Indeed it is a 1:1 thing. So it would be possible to switch the FK's location. But then I'd lose the information in my "n" table if there is something associated or not (FK =3D null). > If you do not have too many relations of this sort, a solution would > be to override the save(..) methods in the persistent Objects. I choose that one! My solution, worked fine on first try: Overriding save(Connection): ---snip--- public void save(Connection con) throws TorqueException { if (getOtherObject() !=3D null) { getOtherObject().save(con); setFkOtherObjectId(getOtherObject().getOtherObjectId()); } super.save(con); } ---snip--- Thank you! Daniel --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org