KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > callback > bean > Customer


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

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 JavaDoc
20 {
21    private int id;
22    private String JavaDoc first;
23    private String JavaDoc last;
24    private String JavaDoc street;
25    private String JavaDoc city;
26    private String JavaDoc state;
27    private String JavaDoc zip;
28
29    public Customer()
30    {
31    }
32
33    public Customer(String JavaDoc first, String JavaDoc last, String JavaDoc street, String JavaDoc city, String JavaDoc state, String JavaDoc 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 JavaDoc getFirst()
56    {
57       return first;
58    }
59
60    public void setFirst(String JavaDoc first)
61    {
62       this.first = first;
63    }
64
65    @Column(name = "LAST")
66    public String JavaDoc getLast()
67    {
68       return last;
69    }
70
71    public void setLast(String JavaDoc last)
72    {
73       this.last = last;
74    }
75
76    @Column(name = "STREET")
77    public String JavaDoc getStreet()
78    {
79       return street;
80    }
81
82    public void setStreet(String JavaDoc street)
83    {
84       this.street = street;
85    }
86
87    @Column(name = "CITY")
88    public String JavaDoc getCity()
89    {
90       return city;
91    }
92
93    public void setCity(String JavaDoc city)
94    {
95       this.city = city;
96    }
97
98    @Column(name = "STATE")
99    public String JavaDoc getState()
100    {
101       return state;
102    }
103
104    public void setState(String JavaDoc state)
105    {
106       this.state = state;
107    }
108
109    @Column(name = "ZIP")
110    public String JavaDoc getZip()
111    {
112       return zip;
113    }
114
115    public void setZip(String JavaDoc zip)
116    {
117       this.zip = zip;
118    }
119 }
120
Popular Tags