KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > petstore > entity > Account


1 /*
2  * JFox - The most lightweight Java EE Application Server!
3  * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
4  *
5  * JFox is licenced and re-distributable under GNU LGPL.
6  */

7 package org.jfox.petstore.entity;
8
9 import java.io.Serializable JavaDoc;
10 import javax.persistence.Column;
11 import javax.persistence.Entity;
12
13 /**
14  * @author <a HREF="mailto:jfox.young@gmail.com">Young Yang</a>
15  */

16 @Entity
17 public class Account implements Serializable JavaDoc, Cloneable JavaDoc {
18
19     @Column(name="userid") // signon.username
20
String JavaDoc username;
21
22     @Column(name = "password") // signon.password
23
String JavaDoc password;
24
25     @Column(name="email")
26     String JavaDoc email;
27
28     @Column(name="firstname")
29     String JavaDoc firstName;
30
31     @Column(name="lastname")
32     String JavaDoc lastName;
33
34     @Column(name="status")
35     String JavaDoc status;
36
37     @Column(name="addr1")
38     String JavaDoc address1;
39
40     @Column(name="addr2")
41     String JavaDoc address2;
42
43     @Column(name="city")
44     String JavaDoc city;
45
46     @Column(name="state")
47     String JavaDoc state;
48
49     @Column(name="zip")
50     String JavaDoc zip;
51
52     @Column(name="country")
53     String JavaDoc country;
54
55     @Column(name="phone")
56     String JavaDoc phone;
57
58     @Column(name="favcategory")
59     String JavaDoc favouriteCategoryId;
60
61     @Column(name="langpref")
62     String JavaDoc languagePreference;
63
64     @Column(name="mylistopt")
65     int listOption;
66
67     @Column(name="banneropt")
68     int bannerOption;
69
70     @Column(name="bannername")
71     String JavaDoc bannerName;
72
73
74     public String JavaDoc getUsername() {
75         return username;
76     }
77
78     public void setUsername(String JavaDoc username) {
79         this.username = username;
80     }
81
82     public String JavaDoc getPassword() {
83         return password;
84     }
85
86     public void setPassword(String JavaDoc password) {
87         this.password = password;
88     }
89
90     public String JavaDoc getEmail() {
91         return email;
92     }
93
94     public void setEmail(String JavaDoc email) {
95         this.email = email;
96     }
97
98     public String JavaDoc getFirstName() {
99         return firstName;
100     }
101
102     public void setFirstName(String JavaDoc firstName) {
103         this.firstName = firstName;
104     }
105
106     public String JavaDoc getLastName() {
107         return lastName;
108     }
109
110     public void setLastName(String JavaDoc lastName) {
111         this.lastName = lastName;
112     }
113
114     public String JavaDoc getStatus() {
115         return status;
116     }
117
118     public void setStatus(String JavaDoc status) {
119         this.status = status;
120     }
121
122     public String JavaDoc getAddress1() {
123         return address1;
124     }
125
126     public void setAddress1(String JavaDoc address1) {
127         this.address1 = address1;
128     }
129
130     public String JavaDoc getAddress2() {
131         return address2;
132     }
133
134     public void setAddress2(String JavaDoc address2) {
135         this.address2 = address2;
136     }
137
138     public String JavaDoc getCity() {
139         return city;
140     }
141
142     public void setCity(String JavaDoc city) {
143         this.city = city;
144     }
145
146     public String JavaDoc getState() {
147         return state;
148     }
149
150     public void setState(String JavaDoc state) {
151         this.state = state;
152     }
153
154     public String JavaDoc getZip() {
155         return zip;
156     }
157
158     public void setZip(String JavaDoc zip) {
159         this.zip = zip;
160     }
161
162     public String JavaDoc getCountry() {
163         return country;
164     }
165
166     public void setCountry(String JavaDoc country) {
167         this.country = country;
168     }
169
170     public String JavaDoc getPhone() {
171         return phone;
172     }
173
174     public void setPhone(String JavaDoc phone) {
175         this.phone = phone;
176     }
177
178     public String JavaDoc getFavouriteCategoryId() {
179         return favouriteCategoryId;
180     }
181
182     public void setFavouriteCategoryId(String JavaDoc favouriteCategoryId) {
183         this.favouriteCategoryId = favouriteCategoryId;
184     }
185
186     public String JavaDoc getLanguagePreference() {
187         return languagePreference;
188     }
189
190     public void setLanguagePreference(String JavaDoc languagePreference) {
191         this.languagePreference = languagePreference;
192     }
193
194     public int getListOption() {
195         return listOption;
196     }
197
198     public void setListOption(int listOption) {
199         this.listOption = listOption;
200     }
201
202     public int getBannerOption() {
203         return bannerOption;
204     }
205
206     public void setBannerOption(int bannerOption) {
207         this.bannerOption = bannerOption;
208     }
209
210     public String JavaDoc getBannerName() {
211         return bannerName;
212     }
213
214     public void setBannerName(String JavaDoc bannerName) {
215         this.bannerName = bannerName;
216     }
217
218     protected Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
219         return super.clone();
220     }
221
222     public static class AccountHelper {
223         public static boolean isListOption(Account account) {
224             return account.getListOption() == 1 ? true : false;
225         }
226
227         public static boolean isBannerOption(Account account) {
228             return account.getBannerOption() == 1 ? true : false;
229         }
230     }
231
232 }
233
Popular Tags