1 7 package org.jboss.tutorial.callback.bean; 8 9 import javax.persistence.Entity; 10 import javax.persistence.Column; 11 import javax.persistence.EntityListener; 12 import javax.persistence.GeneratorType; 13 import javax.persistence.Id; 14 import javax.persistence.Table; 15 16 @Entity 17 @Table(name = "CUSTOMER") 18 @EntityListener(CustomerCallbackListener.class) 19 public class Customer implements java.io.Serializable 20 { 21 private int id; 22 private String first; 23 private String last; 24 private String street; 25 private String city; 26 private String state; 27 private String zip; 28 29 public Customer() 30 { 31 } 32 33 public Customer(String first, String last, String street, String city, String state, String zip) 34 { 35 this.first = first; 36 this.last = last; 37 this.street = street; 38 this.city = city; 39 this.state = state; 40 this.zip = zip; 41 } 42 43 @Id(generate = GeneratorType.AUTO) 44 public int getId() 45 { 46 return id; 47 } 48 49 public void setId(int id) 50 { 51 this.id = id; 52 } 53 54 @Column(name = "FIRST") 55 public String getFirst() 56 { 57 return first; 58 } 59 60 public void setFirst(String first) 61 { 62 this.first = first; 63 } 64 65 @Column(name = "LAST") 66 public String getLast() 67 { 68 return last; 69 } 70 71 public void setLast(String last) 72 { 73 this.last = last; 74 } 75 76 @Column(name = "STREET") 77 public String getStreet() 78 { 79 return street; 80 } 81 82 public void setStreet(String street) 83 { 84 this.street = street; 85 } 86 87 @Column(name = "CITY") 88 public String getCity() 89 { 90 return city; 91 } 92 93 public void setCity(String city) 94 { 95 this.city = city; 96 } 97 98 @Column(name = "STATE") 99 public String getState() 100 { 101 return state; 102 } 103 104 public void setState(String state) 105 { 106 this.state = state; 107 } 108 109 @Column(name = "ZIP") 110 public String getZip() 111 { 112 return zip; 113 } 114 115 public void setZip(String zip) 116 { 117 this.zip = zip; 118 } 119 } 120 | Popular Tags |