1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.model.impl;
24  
25  import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26  import com.liferay.portal.kernel.util.GetterUtil;
27  import com.liferay.portal.kernel.util.HtmlUtil;
28  import com.liferay.portal.model.User;
29  import com.liferay.portal.model.UserSoap;
30  
31  import java.io.Serializable;
32  
33  import java.lang.reflect.Proxy;
34  
35  import java.sql.Types;
36  
37  import java.util.ArrayList;
38  import java.util.Date;
39  import java.util.List;
40  
41  /**
42   * <a href="UserModelImpl.java.html"><b><i>View Source</i></b></a>
43   *
44   * <p>
45   * ServiceBuilder generated this class. Modifications in this class will be
46   * overwritten the next time is generated.
47   * </p>
48   *
49   * <p>
50   * This class is a model that represents the <code>User</code> table
51   * in the database.
52   * </p>
53   *
54   * @author Brian Wing Shun Chan
55   *
56   * @see com.liferay.portal.service.model.User
57   * @see com.liferay.portal.service.model.UserModel
58   * @see com.liferay.portal.service.model.impl.UserImpl
59   *
60   */
61  public class UserModelImpl extends BaseModelImpl {
62      public static final String TABLE_NAME = "User_";
63      public static final Object[][] TABLE_COLUMNS = {
64              { "uuid_", new Integer(Types.VARCHAR) },
65              
66  
67              { "userId", new Integer(Types.BIGINT) },
68              
69  
70              { "companyId", new Integer(Types.BIGINT) },
71              
72  
73              { "createDate", new Integer(Types.TIMESTAMP) },
74              
75  
76              { "modifiedDate", new Integer(Types.TIMESTAMP) },
77              
78  
79              { "defaultUser", new Integer(Types.BOOLEAN) },
80              
81  
82              { "contactId", new Integer(Types.BIGINT) },
83              
84  
85              { "password_", new Integer(Types.VARCHAR) },
86              
87  
88              { "passwordEncrypted", new Integer(Types.BOOLEAN) },
89              
90  
91              { "passwordReset", new Integer(Types.BOOLEAN) },
92              
93  
94              { "passwordModifiedDate", new Integer(Types.TIMESTAMP) },
95              
96  
97              { "graceLoginCount", new Integer(Types.INTEGER) },
98              
99  
100             { "screenName", new Integer(Types.VARCHAR) },
101             
102 
103             { "emailAddress", new Integer(Types.VARCHAR) },
104             
105 
106             { "openId", new Integer(Types.VARCHAR) },
107             
108 
109             { "portraitId", new Integer(Types.BIGINT) },
110             
111 
112             { "languageId", new Integer(Types.VARCHAR) },
113             
114 
115             { "timeZoneId", new Integer(Types.VARCHAR) },
116             
117 
118             { "greeting", new Integer(Types.VARCHAR) },
119             
120 
121             { "comments", new Integer(Types.VARCHAR) },
122             
123 
124             { "loginDate", new Integer(Types.TIMESTAMP) },
125             
126 
127             { "loginIP", new Integer(Types.VARCHAR) },
128             
129 
130             { "lastLoginDate", new Integer(Types.TIMESTAMP) },
131             
132 
133             { "lastLoginIP", new Integer(Types.VARCHAR) },
134             
135 
136             { "lastFailedLoginDate", new Integer(Types.TIMESTAMP) },
137             
138 
139             { "failedLoginAttempts", new Integer(Types.INTEGER) },
140             
141 
142             { "lockout", new Integer(Types.BOOLEAN) },
143             
144 
145             { "lockoutDate", new Integer(Types.TIMESTAMP) },
146             
147 
148             { "agreedToTermsOfUse", new Integer(Types.BOOLEAN) },
149             
150 
151             { "active_", new Integer(Types.BOOLEAN) }
152         };
153     public static final String TABLE_SQL_CREATE = "create table User_ (uuid_ VARCHAR(75) null,userId LONG not null primary key,companyId LONG,createDate DATE null,modifiedDate DATE null,defaultUser BOOLEAN,contactId LONG,password_ VARCHAR(75) null,passwordEncrypted BOOLEAN,passwordReset BOOLEAN,passwordModifiedDate DATE null,graceLoginCount INTEGER,screenName VARCHAR(75) null,emailAddress VARCHAR(75) null,openId VARCHAR(1024) null,portraitId LONG,languageId VARCHAR(75) null,timeZoneId VARCHAR(75) null,greeting VARCHAR(75) null,comments STRING null,loginDate DATE null,loginIP VARCHAR(75) null,lastLoginDate DATE null,lastLoginIP VARCHAR(75) null,lastFailedLoginDate DATE null,failedLoginAttempts INTEGER,lockout BOOLEAN,lockoutDate DATE null,agreedToTermsOfUse BOOLEAN,active_ BOOLEAN)";
154     public static final String TABLE_SQL_DROP = "drop table User_";
155     public static final String DATA_SOURCE = "liferayDataSource";
156     public static final String SESSION_FACTORY = "liferaySessionFactory";
157     public static final String TX_MANAGER = "liferayTransactionManager";
158     public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
159                 "value.object.finder.cache.enabled.com.liferay.portal.model.User"),
160             true);
161 
162     public static User toModel(UserSoap soapModel) {
163         User model = new UserImpl();
164 
165         model.setUuid(soapModel.getUuid());
166         model.setUserId(soapModel.getUserId());
167         model.setCompanyId(soapModel.getCompanyId());
168         model.setCreateDate(soapModel.getCreateDate());
169         model.setModifiedDate(soapModel.getModifiedDate());
170         model.setDefaultUser(soapModel.getDefaultUser());
171         model.setContactId(soapModel.getContactId());
172         model.setPassword(soapModel.getPassword());
173         model.setPasswordEncrypted(soapModel.getPasswordEncrypted());
174         model.setPasswordReset(soapModel.getPasswordReset());
175         model.setPasswordModifiedDate(soapModel.getPasswordModifiedDate());
176         model.setGraceLoginCount(soapModel.getGraceLoginCount());
177         model.setScreenName(soapModel.getScreenName());
178         model.setEmailAddress(soapModel.getEmailAddress());
179         model.setOpenId(soapModel.getOpenId());
180         model.setPortraitId(soapModel.getPortraitId());
181         model.setLanguageId(soapModel.getLanguageId());
182         model.setTimeZoneId(soapModel.getTimeZoneId());
183         model.setGreeting(soapModel.getGreeting());
184         model.setComments(soapModel.getComments());
185         model.setLoginDate(soapModel.getLoginDate());
186         model.setLoginIP(soapModel.getLoginIP());
187         model.setLastLoginDate(soapModel.getLastLoginDate());
188         model.setLastLoginIP(soapModel.getLastLoginIP());
189         model.setLastFailedLoginDate(soapModel.getLastFailedLoginDate());
190         model.setFailedLoginAttempts(soapModel.getFailedLoginAttempts());
191         model.setLockout(soapModel.getLockout());
192         model.setLockoutDate(soapModel.getLockoutDate());
193         model.setAgreedToTermsOfUse(soapModel.getAgreedToTermsOfUse());
194         model.setActive(soapModel.getActive());
195 
196         return model;
197     }
198 
199     public static List<User> toModels(UserSoap[] soapModels) {
200         List<User> models = new ArrayList<User>(soapModels.length);
201 
202         for (UserSoap soapModel : soapModels) {
203             models.add(toModel(soapModel));
204         }
205 
206         return models;
207     }
208 
209     public static final boolean CACHE_ENABLED_USERS_GROUPS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
210                 "value.object.finder.cache.enabled.Users_Groups"), true);
211     public static final boolean CACHE_ENABLED_USERS_ORGS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
212                 "value.object.finder.cache.enabled.Users_Orgs"), true);
213     public static final boolean CACHE_ENABLED_USERS_PERMISSIONS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
214                 "value.object.finder.cache.enabled.Users_Permissions"), true);
215     public static final boolean CACHE_ENABLED_USERS_ROLES = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
216                 "value.object.finder.cache.enabled.Users_Roles"), true);
217     public static final boolean CACHE_ENABLED_USERS_USERGROUPS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
218                 "value.object.finder.cache.enabled.Users_UserGroups"), true);
219     public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
220                 "lock.expiration.time.com.liferay.portal.model.User"));
221 
222     public UserModelImpl() {
223     }
224 
225     public long getPrimaryKey() {
226         return _userId;
227     }
228 
229     public void setPrimaryKey(long pk) {
230         setUserId(pk);
231     }
232 
233     public Serializable getPrimaryKeyObj() {
234         return new Long(_userId);
235     }
236 
237     public String getUuid() {
238         return GetterUtil.getString(_uuid);
239     }
240 
241     public void setUuid(String uuid) {
242         if ((uuid != null) && (uuid != _uuid)) {
243             _uuid = uuid;
244         }
245     }
246 
247     public long getUserId() {
248         return _userId;
249     }
250 
251     public void setUserId(long userId) {
252         if (userId != _userId) {
253             _userId = userId;
254         }
255     }
256 
257     public long getCompanyId() {
258         return _companyId;
259     }
260 
261     public void setCompanyId(long companyId) {
262         if (companyId != _companyId) {
263             _companyId = companyId;
264         }
265     }
266 
267     public Date getCreateDate() {
268         return _createDate;
269     }
270 
271     public void setCreateDate(Date createDate) {
272         if (((createDate == null) && (_createDate != null)) ||
273                 ((createDate != null) && (_createDate == null)) ||
274                 ((createDate != null) && (_createDate != null) &&
275                 !createDate.equals(_createDate))) {
276             _createDate = createDate;
277         }
278     }
279 
280     public Date getModifiedDate() {
281         return _modifiedDate;
282     }
283 
284     public void setModifiedDate(Date modifiedDate) {
285         if (((modifiedDate == null) && (_modifiedDate != null)) ||
286                 ((modifiedDate != null) && (_modifiedDate == null)) ||
287                 ((modifiedDate != null) && (_modifiedDate != null) &&
288                 !modifiedDate.equals(_modifiedDate))) {
289             _modifiedDate = modifiedDate;
290         }
291     }
292 
293     public boolean getDefaultUser() {
294         return _defaultUser;
295     }
296 
297     public boolean isDefaultUser() {
298         return _defaultUser;
299     }
300 
301     public void setDefaultUser(boolean defaultUser) {
302         if (defaultUser != _defaultUser) {
303             _defaultUser = defaultUser;
304         }
305     }
306 
307     public long getContactId() {
308         return _contactId;
309     }
310 
311     public void setContactId(long contactId) {
312         if (contactId != _contactId) {
313             _contactId = contactId;
314         }
315     }
316 
317     public String getPassword() {
318         return GetterUtil.getString(_password);
319     }
320 
321     public void setPassword(String password) {
322         if (((password == null) && (_password != null)) ||
323                 ((password != null) && (_password == null)) ||
324                 ((password != null) && (_password != null) &&
325                 !password.equals(_password))) {
326             _password = password;
327         }
328     }
329 
330     public boolean getPasswordEncrypted() {
331         return _passwordEncrypted;
332     }
333 
334     public boolean isPasswordEncrypted() {
335         return _passwordEncrypted;
336     }
337 
338     public void setPasswordEncrypted(boolean passwordEncrypted) {
339         if (passwordEncrypted != _passwordEncrypted) {
340             _passwordEncrypted = passwordEncrypted;
341         }
342     }
343 
344     public boolean getPasswordReset() {
345         return _passwordReset;
346     }
347 
348     public boolean isPasswordReset() {
349         return _passwordReset;
350     }
351 
352     public void setPasswordReset(boolean passwordReset) {
353         if (passwordReset != _passwordReset) {
354             _passwordReset = passwordReset;
355         }
356     }
357 
358     public Date getPasswordModifiedDate() {
359         return _passwordModifiedDate;
360     }
361 
362     public void setPasswordModifiedDate(Date passwordModifiedDate) {
363         if (((passwordModifiedDate == null) && (_passwordModifiedDate != null)) ||
364                 ((passwordModifiedDate != null) &&
365                 (_passwordModifiedDate == null)) ||
366                 ((passwordModifiedDate != null) &&
367                 (_passwordModifiedDate != null) &&
368                 !passwordModifiedDate.equals(_passwordModifiedDate))) {
369             _passwordModifiedDate = passwordModifiedDate;
370         }
371     }
372 
373     public int getGraceLoginCount() {
374         return _graceLoginCount;
375     }
376 
377     public void setGraceLoginCount(int graceLoginCount) {
378         if (graceLoginCount != _graceLoginCount) {
379             _graceLoginCount = graceLoginCount;
380         }
381     }
382 
383     public String getScreenName() {
384         return GetterUtil.getString(_screenName);
385     }
386 
387     public void setScreenName(String screenName) {
388         if (((screenName == null) && (_screenName != null)) ||
389                 ((screenName != null) && (_screenName == null)) ||
390                 ((screenName != null) && (_screenName != null) &&
391                 !screenName.equals(_screenName))) {
392             _screenName = screenName;
393         }
394     }
395 
396     public String getEmailAddress() {
397         return GetterUtil.getString(_emailAddress);
398     }
399 
400     public void setEmailAddress(String emailAddress) {
401         if (((emailAddress == null) && (_emailAddress != null)) ||
402                 ((emailAddress != null) && (_emailAddress == null)) ||
403                 ((emailAddress != null) && (_emailAddress != null) &&
404                 !emailAddress.equals(_emailAddress))) {
405             _emailAddress = emailAddress;
406         }
407     }
408 
409     public String getOpenId() {
410         return GetterUtil.getString(_openId);
411     }
412 
413     public void setOpenId(String openId) {
414         if (((openId == null) && (_openId != null)) ||
415                 ((openId != null) && (_openId == null)) ||
416                 ((openId != null) && (_openId != null) &&
417                 !openId.equals(_openId))) {
418             _openId = openId;
419         }
420     }
421 
422     public long getPortraitId() {
423         return _portraitId;
424     }
425 
426     public void setPortraitId(long portraitId) {
427         if (portraitId != _portraitId) {
428             _portraitId = portraitId;
429         }
430     }
431 
432     public String getLanguageId() {
433         return GetterUtil.getString(_languageId);
434     }
435 
436     public void setLanguageId(String languageId) {
437         if (((languageId == null) && (_languageId != null)) ||
438                 ((languageId != null) && (_languageId == null)) ||
439                 ((languageId != null) && (_languageId != null) &&
440                 !languageId.equals(_languageId))) {
441             _languageId = languageId;
442         }
443     }
444 
445     public String getTimeZoneId() {
446         return GetterUtil.getString(_timeZoneId);
447     }
448 
449     public void setTimeZoneId(String timeZoneId) {
450         if (((timeZoneId == null) && (_timeZoneId != null)) ||
451                 ((timeZoneId != null) && (_timeZoneId == null)) ||
452                 ((timeZoneId != null) && (_timeZoneId != null) &&
453                 !timeZoneId.equals(_timeZoneId))) {
454             _timeZoneId = timeZoneId;
455         }
456     }
457 
458     public String getGreeting() {
459         return GetterUtil.getString(_greeting);
460     }
461 
462     public void setGreeting(String greeting) {
463         if (((greeting == null) && (_greeting != null)) ||
464                 ((greeting != null) && (_greeting == null)) ||
465                 ((greeting != null) && (_greeting != null) &&
466                 !greeting.equals(_greeting))) {
467             _greeting = greeting;
468         }
469     }
470 
471     public String getComments() {
472         return GetterUtil.getString(_comments);
473     }
474 
475     public void setComments(String comments) {
476         if (((comments == null) && (_comments != null)) ||
477                 ((comments != null) && (_comments == null)) ||
478                 ((comments != null) && (_comments != null) &&
479                 !comments.equals(_comments))) {
480             _comments = comments;
481         }
482     }
483 
484     public Date getLoginDate() {
485         return _loginDate;
486     }
487 
488     public void setLoginDate(Date loginDate) {
489         if (((loginDate == null) && (_loginDate != null)) ||
490                 ((loginDate != null) && (_loginDate == null)) ||
491                 ((loginDate != null) && (_loginDate != null) &&
492                 !loginDate.equals(_loginDate))) {
493             _loginDate = loginDate;
494         }
495     }
496 
497     public String getLoginIP() {
498         return GetterUtil.getString(_loginIP);
499     }
500 
501     public void setLoginIP(String loginIP) {
502         if (((loginIP == null) && (_loginIP != null)) ||
503                 ((loginIP != null) && (_loginIP == null)) ||
504                 ((loginIP != null) && (_loginIP != null) &&
505                 !loginIP.equals(_loginIP))) {
506             _loginIP = loginIP;
507         }
508     }
509 
510     public Date getLastLoginDate() {
511         return _lastLoginDate;
512     }
513 
514     public void setLastLoginDate(Date lastLoginDate) {
515         if (((lastLoginDate == null) && (_lastLoginDate != null)) ||
516                 ((lastLoginDate != null) && (_lastLoginDate == null)) ||
517                 ((lastLoginDate != null) && (_lastLoginDate != null) &&
518                 !lastLoginDate.equals(_lastLoginDate))) {
519             _lastLoginDate = lastLoginDate;
520         }
521     }
522 
523     public String getLastLoginIP() {
524         return GetterUtil.getString(_lastLoginIP);
525     }
526 
527     public void setLastLoginIP(String lastLoginIP) {
528         if (((lastLoginIP == null) && (_lastLoginIP != null)) ||
529                 ((lastLoginIP != null) && (_lastLoginIP == null)) ||
530                 ((lastLoginIP != null) && (_lastLoginIP != null) &&
531                 !lastLoginIP.equals(_lastLoginIP))) {
532             _lastLoginIP = lastLoginIP;
533         }
534     }
535 
536     public Date getLastFailedLoginDate() {
537         return _lastFailedLoginDate;
538     }
539 
540     public void setLastFailedLoginDate(Date lastFailedLoginDate) {
541         if (((lastFailedLoginDate == null) && (_lastFailedLoginDate != null)) ||
542                 ((lastFailedLoginDate != null) &&
543                 (_lastFailedLoginDate == null)) ||
544                 ((lastFailedLoginDate != null) &&
545                 (_lastFailedLoginDate != null) &&
546                 !lastFailedLoginDate.equals(_lastFailedLoginDate))) {
547             _lastFailedLoginDate = lastFailedLoginDate;
548         }
549     }
550 
551     public int getFailedLoginAttempts() {
552         return _failedLoginAttempts;
553     }
554 
555     public void setFailedLoginAttempts(int failedLoginAttempts) {
556         if (failedLoginAttempts != _failedLoginAttempts) {
557             _failedLoginAttempts = failedLoginAttempts;
558         }
559     }
560 
561     public boolean getLockout() {
562         return _lockout;
563     }
564 
565     public boolean isLockout() {
566         return _lockout;
567     }
568 
569     public void setLockout(boolean lockout) {
570         if (lockout != _lockout) {
571             _lockout = lockout;
572         }
573     }
574 
575     public Date getLockoutDate() {
576         return _lockoutDate;
577     }
578 
579     public void setLockoutDate(Date lockoutDate) {
580         if (((lockoutDate == null) && (_lockoutDate != null)) ||
581                 ((lockoutDate != null) && (_lockoutDate == null)) ||
582                 ((lockoutDate != null) && (_lockoutDate != null) &&
583                 !lockoutDate.equals(_lockoutDate))) {
584             _lockoutDate = lockoutDate;
585         }
586     }
587 
588     public boolean getAgreedToTermsOfUse() {
589         return _agreedToTermsOfUse;
590     }
591 
592     public boolean isAgreedToTermsOfUse() {
593         return _agreedToTermsOfUse;
594     }
595 
596     public void setAgreedToTermsOfUse(boolean agreedToTermsOfUse) {
597         if (agreedToTermsOfUse != _agreedToTermsOfUse) {
598             _agreedToTermsOfUse = agreedToTermsOfUse;
599         }
600     }
601 
602     public boolean getActive() {
603         return _active;
604     }
605 
606     public boolean isActive() {
607         return _active;
608     }
609 
610     public void setActive(boolean active) {
611         if (active != _active) {
612             _active = active;
613         }
614     }
615 
616     public User toEscapedModel() {
617         if (isEscapedModel()) {
618             return (User)this;
619         }
620         else {
621             User model = new UserImpl();
622 
623             model.setEscapedModel(true);
624 
625             model.setUuid(HtmlUtil.escape(getUuid()));
626             model.setUserId(getUserId());
627             model.setCompanyId(getCompanyId());
628             model.setCreateDate(getCreateDate());
629             model.setModifiedDate(getModifiedDate());
630             model.setDefaultUser(getDefaultUser());
631             model.setContactId(getContactId());
632             model.setPassword(HtmlUtil.escape(getPassword()));
633             model.setPasswordEncrypted(getPasswordEncrypted());
634             model.setPasswordReset(getPasswordReset());
635             model.setPasswordModifiedDate(getPasswordModifiedDate());
636             model.setGraceLoginCount(getGraceLoginCount());
637             model.setScreenName(HtmlUtil.escape(getScreenName()));
638             model.setEmailAddress(HtmlUtil.escape(getEmailAddress()));
639             model.setOpenId(HtmlUtil.escape(getOpenId()));
640             model.setPortraitId(getPortraitId());
641             model.setLanguageId(HtmlUtil.escape(getLanguageId()));
642             model.setTimeZoneId(HtmlUtil.escape(getTimeZoneId()));
643             model.setGreeting(HtmlUtil.escape(getGreeting()));
644             model.setComments(HtmlUtil.escape(getComments()));
645             model.setLoginDate(getLoginDate());
646             model.setLoginIP(HtmlUtil.escape(getLoginIP()));
647             model.setLastLoginDate(getLastLoginDate());
648             model.setLastLoginIP(HtmlUtil.escape(getLastLoginIP()));
649             model.setLastFailedLoginDate(getLastFailedLoginDate());
650             model.setFailedLoginAttempts(getFailedLoginAttempts());
651             model.setLockout(getLockout());
652             model.setLockoutDate(getLockoutDate());
653             model.setAgreedToTermsOfUse(getAgreedToTermsOfUse());
654             model.setActive(getActive());
655 
656             model = (User)Proxy.newProxyInstance(User.class.getClassLoader(),
657                     new Class[] { User.class }, new ReadOnlyBeanHandler(model));
658 
659             return model;
660         }
661     }
662 
663     public Object clone() {
664         UserImpl clone = new UserImpl();
665 
666         clone.setUuid(getUuid());
667         clone.setUserId(getUserId());
668         clone.setCompanyId(getCompanyId());
669         clone.setCreateDate(getCreateDate());
670         clone.setModifiedDate(getModifiedDate());
671         clone.setDefaultUser(getDefaultUser());
672         clone.setContactId(getContactId());
673         clone.setPassword(getPassword());
674         clone.setPasswordEncrypted(getPasswordEncrypted());
675         clone.setPasswordReset(getPasswordReset());
676         clone.setPasswordModifiedDate(getPasswordModifiedDate());
677         clone.setGraceLoginCount(getGraceLoginCount());
678         clone.setScreenName(getScreenName());
679         clone.setEmailAddress(getEmailAddress());
680         clone.setOpenId(getOpenId());
681         clone.setPortraitId(getPortraitId());
682         clone.setLanguageId(getLanguageId());
683         clone.setTimeZoneId(getTimeZoneId());
684         clone.setGreeting(getGreeting());
685         clone.setComments(getComments());
686         clone.setLoginDate(getLoginDate());
687         clone.setLoginIP(getLoginIP());
688         clone.setLastLoginDate(getLastLoginDate());
689         clone.setLastLoginIP(getLastLoginIP());
690         clone.setLastFailedLoginDate(getLastFailedLoginDate());
691         clone.setFailedLoginAttempts(getFailedLoginAttempts());
692         clone.setLockout(getLockout());
693         clone.setLockoutDate(getLockoutDate());
694         clone.setAgreedToTermsOfUse(getAgreedToTermsOfUse());
695         clone.setActive(getActive());
696 
697         return clone;
698     }
699 
700     public int compareTo(Object obj) {
701         if (obj == null) {
702             return -1;
703         }
704 
705         UserImpl user = (UserImpl)obj;
706 
707         long pk = user.getPrimaryKey();
708 
709         if (getPrimaryKey() < pk) {
710             return -1;
711         }
712         else if (getPrimaryKey() > pk) {
713             return 1;
714         }
715         else {
716             return 0;
717         }
718     }
719 
720     public boolean equals(Object obj) {
721         if (obj == null) {
722             return false;
723         }
724 
725         UserImpl user = null;
726 
727         try {
728             user = (UserImpl)obj;
729         }
730         catch (ClassCastException cce) {
731             return false;
732         }
733 
734         long pk = user.getPrimaryKey();
735 
736         if (getPrimaryKey() == pk) {
737             return true;
738         }
739         else {
740             return false;
741         }
742     }
743 
744     public int hashCode() {
745         return (int)getPrimaryKey();
746     }
747 
748     private String _uuid;
749     private long _userId;
750     private long _companyId;
751     private Date _createDate;
752     private Date _modifiedDate;
753     private boolean _defaultUser;
754     private long _contactId;
755     private String _password;
756     private boolean _passwordEncrypted;
757     private boolean _passwordReset;
758     private Date _passwordModifiedDate;
759     private int _graceLoginCount;
760     private String _screenName;
761     private String _emailAddress;
762     private String _openId;
763     private long _portraitId;
764     private String _languageId;
765     private String _timeZoneId;
766     private String _greeting;
767     private String _comments;
768     private Date _loginDate;
769     private String _loginIP;
770     private Date _lastLoginDate;
771     private String _lastLoginIP;
772     private Date _lastFailedLoginDate;
773     private int _failedLoginAttempts;
774     private boolean _lockout;
775     private Date _lockoutDate;
776     private boolean _agreedToTermsOfUse;
777     private boolean _active;
778 }