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