001: /*
002: * Coefficient - facilitates project based collaboration
003: * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
004: * PO Box 395
005: * Pretoria 0001, RSA
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019:
020: package za.org.coefficient.authentication;
021:
022: import java.util.Date;
023: import java.util.Locale;
024: import java.util.TimeZone;
025:
026: /**
027: * @hibernate.class
028: * table="COEFFICIENT_USER"
029: */
030: public class CoefficientUser implements java.io.Serializable {
031: //~ Instance fields ========================================================
032:
033: private Date createDate;
034: private Locale language;
035: private Long id;
036: private Role systemRole;
037: private String email;
038: private String fullName;
039: private String password;
040: private String userName;
041: private TimeZone timeZone;
042: private boolean active;
043: private boolean hideInformation;
044: private long confId;
045: private long version;
046: //pvz: this will be used to create alias e-mail addresses to hide the users real e-mail address.
047: private String aliasEmail;
048:
049: //~ Constructors ===========================================================
050:
051: public CoefficientUser() {
052: createDate = new Date(System.currentTimeMillis());
053: hideInformation = false;
054: }
055:
056: //~ Methods ================================================================
057:
058: /**
059: * Sets the value of active
060: *
061: * @param active Value to assign to this.active
062: */
063: public void setActive(boolean active) {
064: this .active = active;
065: }
066:
067: /**
068: * Gets the value of active
069: *
070: * @return the value of active
071: * @hibernate.property
072: * column="ACTIVE"
073: * not-null="true"
074: */
075: public boolean getActive() {
076: return this .active;
077: }
078:
079: /**
080: * Sets the value of active
081: *
082: * @param argEmail Value to assign to this.email
083: */
084: public void setConfirmationId(long confirmationId) {
085: this .confId = confirmationId;
086: }
087:
088: /**
089: * Gets the value of confirmationId
090: *
091: * @return the value of confirmationId
092: * @hibernate.property
093: * column="CONFIRMATION_ID"
094: */
095: public long getConfirmationId() {
096: return this .confId;
097: }
098:
099: /**
100: * Sets the value of create date
101: *
102: * @param createDate Value to assign to this.createDate
103: */
104: public void setCreateDate(Date createDate) {
105: this .createDate = createDate;
106: }
107:
108: /**
109: * Gets the value of create date
110: *
111: * @return the value of create date
112: * @hibernate.property
113: * column="CREATE_DATE"
114: */
115: public Date getCreateDate() {
116: return this .createDate;
117: }
118:
119: /**
120: * Sets the value of email
121: *
122: * @param argEmail Value to assign to this.email
123: */
124: public void setEmail(String argEmail) {
125: this .email = argEmail;
126: }
127:
128: /**
129: * Gets the value of email
130: *
131: * @return the value of email
132: * @hibernate.property
133: * column="EMAIL"
134: * not-null="true"
135: */
136: public String getEmail() {
137: return this .email;
138: }
139:
140: /**
141: * Sets the value of fullName
142: *
143: * @param argFullName Value to assign to this.fullName
144: */
145: public void setFullName(String argFullName) {
146: this .fullName = argFullName;
147: }
148:
149: /**
150: * Gets the value of fullName
151: *
152: * @return the value of fullName
153: * @hibernate.property
154: * column="FULLNAME"
155: * not-null="true"
156: */
157: public String getFullName() {
158: return this .fullName;
159: }
160:
161: /**
162: * Sets the value of hideInformation
163: *
164: * @param hideInformation Value to assign to this.hideInformation
165: */
166: public void setHideInformation(boolean hideInformation) {
167: this .hideInformation = hideInformation;
168: }
169:
170: /**
171: * Gets the value of hideInformation
172: *
173: * @return the value of hideInformation
174: * @hibernate.property
175: * column="HIDE_INFORMATION"
176: * not-null="true"
177: */
178: public boolean getHideInformation() {
179: return this .hideInformation;
180: }
181:
182: public void setId(Long id) {
183: this .id = id;
184: }
185:
186: /**
187: * @hibernate.id
188: * generator-class="native"
189: */
190: public Long getId() {
191: return id;
192: }
193:
194: /**
195: * Sets the value of language
196: *
197: * @param argLanguage Value to assign to this.language
198: */
199: public void setLanguage(Locale argLanguage) {
200: this .language = argLanguage;
201: }
202:
203: /**
204: * Gets the value of language
205: *
206: * @return the value of language
207: * @hibernate.property
208: * type="locale"
209: * column="LANGUAGE"
210: * not-null="true"
211: */
212: public Locale getLanguage() {
213: return this .language;
214: }
215:
216: /**
217: * Sets the value of password
218: *
219: * @param argPassword Value to assign to this.password
220: */
221: public void setPassword(String argPassword) {
222: this .password = argPassword;
223: }
224:
225: /**
226: * Gets the value of password
227: *
228: * @return the value of password
229: * @hibernate.property
230: * column="PASSWORD"
231: * not-null="true"
232: */
233: public String getPassword() {
234: return this .password;
235: }
236:
237: /**
238: * Sets the value of systemRole
239: *
240: * @param systemRole Value to assign to this.systemRole
241: */
242: public void setSystemRole(Role systemRole) {
243: this .systemRole = systemRole;
244: }
245:
246: /**
247: * Gets the value of role
248: *
249: * @return the value of role
250: * @hibernate.many-to-one
251: * not-null="true"
252: * column="SYSTEM_ROLE"
253: */
254: public Role getSystemRole() {
255: return this .systemRole;
256: }
257:
258: /**
259: * Sets the value of timeZone
260: *
261: * @param argTimeZone Value to assign to this.timeZone
262: */
263: public void setTimeZone(TimeZone argTimeZone) {
264: this .timeZone = argTimeZone;
265: }
266:
267: /**
268: * Gets the value of timeZone
269: *
270: * @return the value of timeZone
271: * @hibernate.property
272: * type="timezone"
273: * column="TIME_ZONE"
274: * not-null="true"
275: */
276: public TimeZone getTimeZone() {
277: return this .timeZone;
278: }
279:
280: /**
281: * Sets the value of userName
282: *
283: * @param argUserName Value to assign to this.userName
284: */
285: public void setUserName(String argUserName) {
286: this .userName = argUserName;
287: }
288:
289: /**
290: * Gets the value of userName
291: *
292: * @return the value of userName
293: * @hibernate.property
294: * column="USERNAME"
295: * unique="true"
296: * not-null="true"
297: */
298: public String getUserName() {
299: return this .userName;
300: }
301:
302: /**
303: * Sets the value of version
304: *
305: * @param version Value to assign to this.version
306: */
307: public void setVersion(long version) {
308: this .version = version;
309: }
310:
311: /**
312: * Gets the value of version
313: *
314: * @return the value of version
315: * @hibernate.version
316: * column="VERSION"
317: * type="long"
318: */
319: public long getVersion() {
320: return this .version;
321: }
322:
323: public boolean equals(Object other) {
324: CoefficientUser o = (CoefficientUser) other;
325:
326: return (this != null)
327: && (o != null)
328: && (((userName == null) && (o.userName == null)) || userName
329: .equals(o.userName))
330: && (((password == null) && (o.password == null)) || password
331: .equals(o.password));
332: }
333:
334: public String toString() {
335: return getFullName();
336: }
337:
338: /**
339: * @return Returns the aliasEmail.
340: * May 16, 2005
341: * pieter20
342: * @hibernate.property
343: * column="ALIAS_EMAIL"
344: *
345: */
346: public String getAliasEmail() {
347: return aliasEmail;
348: }
349:
350: /**
351: * @param aliasEmail The aliasEmail to set.
352: * May 16, 2005
353: * pieter20
354: */
355: public void setAliasEmail(String aliasEmail) {
356: this.aliasEmail = aliasEmail;
357: }
358:
359: }
|