001: /*
002: * JFox - The most lightweight Java EE Application Server!
003: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
004: *
005: * JFox is licenced and re-distributable under GNU LGPL.
006: */
007: package org.jfox.petstore.entity;
008:
009: import java.io.Serializable;
010: import javax.persistence.Column;
011: import javax.persistence.Entity;
012:
013: /**
014: * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
015: */
016: @Entity
017: public class Account implements Serializable, Cloneable {
018:
019: @Column(name="userid")
020: // signon.username
021: String username;
022:
023: @Column(name="password")
024: // signon.password
025: String password;
026:
027: @Column(name="email")
028: String email;
029:
030: @Column(name="firstname")
031: String firstName;
032:
033: @Column(name="lastname")
034: String lastName;
035:
036: @Column(name="status")
037: String status;
038:
039: @Column(name="addr1")
040: String address1;
041:
042: @Column(name="addr2")
043: String address2;
044:
045: @Column(name="city")
046: String city;
047:
048: @Column(name="state")
049: String state;
050:
051: @Column(name="zip")
052: String zip;
053:
054: @Column(name="country")
055: String country;
056:
057: @Column(name="phone")
058: String phone;
059:
060: @Column(name="favcategory")
061: String favouriteCategoryId;
062:
063: @Column(name="langpref")
064: String languagePreference;
065:
066: @Column(name="mylistopt")
067: int listOption;
068:
069: @Column(name="banneropt")
070: int bannerOption;
071:
072: @Column(name="bannername")
073: String bannerName;
074:
075: public String getUsername() {
076: return username;
077: }
078:
079: public void setUsername(String username) {
080: this .username = username;
081: }
082:
083: public String getPassword() {
084: return password;
085: }
086:
087: public void setPassword(String password) {
088: this .password = password;
089: }
090:
091: public String getEmail() {
092: return email;
093: }
094:
095: public void setEmail(String email) {
096: this .email = email;
097: }
098:
099: public String getFirstName() {
100: return firstName;
101: }
102:
103: public void setFirstName(String firstName) {
104: this .firstName = firstName;
105: }
106:
107: public String getLastName() {
108: return lastName;
109: }
110:
111: public void setLastName(String lastName) {
112: this .lastName = lastName;
113: }
114:
115: public String getStatus() {
116: return status;
117: }
118:
119: public void setStatus(String status) {
120: this .status = status;
121: }
122:
123: public String getAddress1() {
124: return address1;
125: }
126:
127: public void setAddress1(String address1) {
128: this .address1 = address1;
129: }
130:
131: public String getAddress2() {
132: return address2;
133: }
134:
135: public void setAddress2(String address2) {
136: this .address2 = address2;
137: }
138:
139: public String getCity() {
140: return city;
141: }
142:
143: public void setCity(String city) {
144: this .city = city;
145: }
146:
147: public String getState() {
148: return state;
149: }
150:
151: public void setState(String state) {
152: this .state = state;
153: }
154:
155: public String getZip() {
156: return zip;
157: }
158:
159: public void setZip(String zip) {
160: this .zip = zip;
161: }
162:
163: public String getCountry() {
164: return country;
165: }
166:
167: public void setCountry(String country) {
168: this .country = country;
169: }
170:
171: public String getPhone() {
172: return phone;
173: }
174:
175: public void setPhone(String phone) {
176: this .phone = phone;
177: }
178:
179: public String getFavouriteCategoryId() {
180: return favouriteCategoryId;
181: }
182:
183: public void setFavouriteCategoryId(String favouriteCategoryId) {
184: this .favouriteCategoryId = favouriteCategoryId;
185: }
186:
187: public String getLanguagePreference() {
188: return languagePreference;
189: }
190:
191: public void setLanguagePreference(String languagePreference) {
192: this .languagePreference = languagePreference;
193: }
194:
195: public int getListOption() {
196: return listOption;
197: }
198:
199: public void setListOption(int listOption) {
200: this .listOption = listOption;
201: }
202:
203: public int getBannerOption() {
204: return bannerOption;
205: }
206:
207: public void setBannerOption(int bannerOption) {
208: this .bannerOption = bannerOption;
209: }
210:
211: public String getBannerName() {
212: return bannerName;
213: }
214:
215: public void setBannerName(String bannerName) {
216: this .bannerName = bannerName;
217: }
218:
219: protected Object clone() throws CloneNotSupportedException {
220: return super .clone();
221: }
222:
223: public static class AccountHelper {
224: public static boolean isListOption(Account account) {
225: return account.getListOption() == 1 ? true : false;
226: }
227:
228: public static boolean isBannerOption(Account account) {
229: return account.getBannerOption() == 1 ? true : false;
230: }
231: }
232:
233: }
|