Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 80840 invoked from network); 17 Oct 2006 15:01:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Oct 2006 15:01:52 -0000 Received: (qmail 99547 invoked by uid 500); 17 Oct 2006 15:01:49 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 99492 invoked by uid 500); 17 Oct 2006 15:01:48 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 99438 invoked by uid 99); 17 Oct 2006 15:01:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 08:01:48 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 08:01:44 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GZqRX-0001AZ-Ro for user-java@ibatis.apache.org; Tue, 17 Oct 2006 08:01:23 -0700 Message-ID: <6857135.post@talk.nabble.com> Date: Tue, 17 Oct 2006 08:01:23 -0700 (PDT) From: soussou97 To: user-java@ibatis.apache.org Subject: Composite objects MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: dboussebha@yahoo.fr X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi; I have a two java Beans as follows : public class Person implements serializable { private Name name; private String key; private List account = new ArrayList(); public String getKey() { return key; } private void setKey(String key) { this.key=key; } public Name getName() { return name; } public void setName(Name name) { this.name = name; } public void setAccount(List accounts) { this.accounts = accounts; } public List getAccounts() { return account; } ...... } public class Account implements Serializable { private String username; private String password; private String email; private String firstName; private String lastName; private String status; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } } And I would like to realize the method DAO for creating a new person with its accounts, getting all person into the database with the accounts and updating a person with its accounts. I have the following methodes DAO : insertAccount(Account a) insertPerson (Person p) UpdateAccount(Account a) UpdatePerson(Person p) getAllPerson(String key) getAllAccount(String name, String password) Question : how I must realize the link between the two objects, for example for the "insertPerson" DAO, I must firstly to insert the liste of accounts next the person or inside of the method "insertPerson" DAO I call "insertAccount" DAO to get the list of accounts ? In the same way for the "getAllPerson" which return a Person object. Generally how to implement the composite objects with Ibatis. Regards; -- View this message in context: http://www.nabble.com/Composite-objects-tf2460146.html#a6857135 Sent from the iBATIS - User - Java mailing list archive at Nabble.com.