1 package ejava.examples.ejbsessionbank.dto; 2 3 import java.io.Serializable; 4 5 public class OwnerDTO implements Serializable { 6 private static final long serialVersionUID = 1L; 7 private long id; 8 private String firstName; 9 private String lastName; 10 private int accounts; 11 12 public OwnerDTO() {} 13 public OwnerDTO(long id) { 14 this.id = id; 15 } 16 public OwnerDTO(long id, String firstName, String lastName, int accounts) { 17 this(id); 18 this.firstName = firstName; 19 this.lastName = lastName; 20 this.accounts = accounts; 21 } 22 23 public long getId() { 24 return id; 25 } 26 public void setId(long id) { 27 this.id = id; 28 } 29 public String getFirstName() { 30 return firstName; 31 } 32 public void setFirstName(String firstName) { 33 this.firstName = firstName; 34 } 35 public String getLastName() { 36 return lastName; 37 } 38 public void setLastName(String lastName) { 39 this.lastName = lastName; 40 } 41 public int getAccounts() { 42 return accounts; 43 } 44 public void setAccounts(int accounts) { 45 this.accounts = accounts; 46 } 47 48 public String toString() { 49 StringBuilder text = new StringBuilder(); 50 text.append("id=" + id); 51 text.append(", firstName=" + firstName); 52 text.append(", lastName=" + lastName); 53 text.append(", accounts=" + accounts); 54 return text.toString(); 55 } 56 }