1 22 package org.jboss.ejb3.test.bank; 23 24 import java.util.*; 25 26 27 32 public class CustomerBean 33 { 34 36 public String id; 38 39 public String name; 40 41 public Collection accounts; 42 43 45 47 public String getId() 49 { 50 return id; 51 } 52 53 public void setId(String id) 54 { 55 this.id = id; 56 } 57 58 public String getName() 59 { 60 return name; 61 } 62 63 public void setName(String name) 64 { 65 this.name = name; 66 } 67 68 public Collection getAccounts() 69 { 70 return accounts; 71 } 72 73 public void addAccount(Account acct) 74 { 75 accounts.add(acct); 76 } 77 78 public void removeAccount(Account acct) 79 { 80 accounts.remove(acct); 81 } 82 83 public CustomerPK ejbCreate(String id, String name) 85 { 86 setId(id); 87 setName(name); 88 accounts = new ArrayList(); 89 90 CustomerPK pk = new CustomerPK(); 91 pk.id = id; 92 pk.name = name; 93 94 return pk; 95 } 96 97 public void ejbPostCreate(String id, String name) 98 { 99 } 100 } 101 102 123 | Popular Tags |