Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 88151 invoked from network); 22 Feb 2005 14:50:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Feb 2005 14:50:40 -0000 Received: (qmail 26444 invoked by uid 500); 22 Feb 2005 14:50:38 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 26429 invoked by uid 500); 22 Feb 2005 14:50:38 -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 26415 invoked by uid 99); 22 Feb 2005 14:50:38 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from hoespc01.exxonmobil.com (HELO hoespc01.exxonmobil.com) (192.67.48.38) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 22 Feb 2005 06:50:37 -0800 Received: from hounmg03.NA.XOM.COM (hounmg03.na.xom.com [158.35.101.41]) by hoespc01.exxonmobil.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j1MEoVHD025031 for ; Tue, 22 Feb 2005 08:50:33 -0600 (CST) Subject: Re: Arrays in OM classes To: "Apache Torque Users List" Cc: torque-user@db.apache.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: adam.s.allgaier@exxonmobil.com Date: Tue, 22 Feb 2005 08:50:30 -0600 X-MIMETrack: Serialize by Router on Hounmg03.na.xom.com/S/ExxonMobil(652HF702|December 14, 2004) at 02/22/2005 08:50:33 AM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Typically, your query of the Contact table would look like this: Criteria criteria = new Criteria(); criteria.add...... //add your criteria here List results = ContactPeer.doSelect(criteria); //get the list of results Contact contact = (Contact)results.get(0); //get the first result List phoneNumbers = contact.getPhoneNumbers(); //get the list of phone numbers associated with this contact The "contact.getPhoneNumbers()" method will be automatically generated with your OM if your phone number table has a foreign key reference to the contact table. It's slick stuff. Adam "Kintzel Levente" cc: Subject: Arrays in OM classes 02/22/05 07:29 AM Please respond to "Apache Torque Users List" Hi! I have a simple design question. I want to creat a database with contact information (id, name, adress, phone no), but the contact can have more than one phonenumber. The simplest solution for this problem is the normalization and to create 2 tables (one with id, name and adress and one with the id and phone numbers), but I want to be able to load automatically all phone numbers when I load the data of one contact. In other words to have an array in the generated ContactOM class. Is that possible? Or there are some design solutions for this problem? Thank You Levente Kintzel --------------------------------------------------------------------- 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