001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSON;
020    import com.liferay.portal.kernel.util.GetterUtil;
021    import com.liferay.portal.kernel.util.ProxyUtil;
022    import com.liferay.portal.kernel.util.StringBundler;
023    import com.liferay.portal.kernel.util.StringPool;
024    import com.liferay.portal.model.CacheModel;
025    import com.liferay.portal.model.User;
026    import com.liferay.portal.model.UserModel;
027    import com.liferay.portal.model.UserSoap;
028    import com.liferay.portal.service.ServiceContext;
029    import com.liferay.portal.util.PortalUtil;
030    
031    import com.liferay.portlet.expando.model.ExpandoBridge;
032    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
033    
034    import java.io.Serializable;
035    
036    import java.sql.Types;
037    
038    import java.util.ArrayList;
039    import java.util.Date;
040    import java.util.HashMap;
041    import java.util.List;
042    import java.util.Map;
043    
044    /**
045     * The base model implementation for the User service. Represents a row in the "User_" database table, with each column mapped to a property of this class.
046     *
047     * <p>
048     * This implementation and its corresponding interface {@link com.liferay.portal.model.UserModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link UserImpl}.
049     * </p>
050     *
051     * @author Brian Wing Shun Chan
052     * @see UserImpl
053     * @see com.liferay.portal.model.User
054     * @see com.liferay.portal.model.UserModel
055     * @generated
056     */
057    @JSON(strict = true)
058    public class UserModelImpl extends BaseModelImpl<User> implements UserModel {
059            /*
060             * NOTE FOR DEVELOPERS:
061             *
062             * Never modify or reference this class directly. All methods that expect a user model instance should use the {@link com.liferay.portal.model.User} interface instead.
063             */
064            public static final String TABLE_NAME = "User_";
065            public static final Object[][] TABLE_COLUMNS = {
066                            { "uuid_", Types.VARCHAR },
067                            { "userId", Types.BIGINT },
068                            { "companyId", Types.BIGINT },
069                            { "createDate", Types.TIMESTAMP },
070                            { "modifiedDate", Types.TIMESTAMP },
071                            { "defaultUser", Types.BOOLEAN },
072                            { "contactId", Types.BIGINT },
073                            { "password_", Types.VARCHAR },
074                            { "passwordEncrypted", Types.BOOLEAN },
075                            { "passwordReset", Types.BOOLEAN },
076                            { "passwordModifiedDate", Types.TIMESTAMP },
077                            { "digest", Types.VARCHAR },
078                            { "reminderQueryQuestion", Types.VARCHAR },
079                            { "reminderQueryAnswer", Types.VARCHAR },
080                            { "graceLoginCount", Types.INTEGER },
081                            { "screenName", Types.VARCHAR },
082                            { "emailAddress", Types.VARCHAR },
083                            { "facebookId", Types.BIGINT },
084                            { "openId", Types.VARCHAR },
085                            { "portraitId", Types.BIGINT },
086                            { "languageId", Types.VARCHAR },
087                            { "timeZoneId", Types.VARCHAR },
088                            { "greeting", Types.VARCHAR },
089                            { "comments", Types.VARCHAR },
090                            { "firstName", Types.VARCHAR },
091                            { "middleName", Types.VARCHAR },
092                            { "lastName", Types.VARCHAR },
093                            { "jobTitle", Types.VARCHAR },
094                            { "loginDate", Types.TIMESTAMP },
095                            { "loginIP", Types.VARCHAR },
096                            { "lastLoginDate", Types.TIMESTAMP },
097                            { "lastLoginIP", Types.VARCHAR },
098                            { "lastFailedLoginDate", Types.TIMESTAMP },
099                            { "failedLoginAttempts", Types.INTEGER },
100                            { "lockout", Types.BOOLEAN },
101                            { "lockoutDate", Types.TIMESTAMP },
102                            { "agreedToTermsOfUse", Types.BOOLEAN },
103                            { "emailAddressVerified", Types.BOOLEAN },
104                            { "status", Types.INTEGER }
105                    };
106            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,digest VARCHAR(255) null,reminderQueryQuestion VARCHAR(75) null,reminderQueryAnswer VARCHAR(75) null,graceLoginCount INTEGER,screenName VARCHAR(75) null,emailAddress VARCHAR(75) null,facebookId LONG,openId VARCHAR(1024) null,portraitId LONG,languageId VARCHAR(75) null,timeZoneId VARCHAR(75) null,greeting VARCHAR(255) null,comments STRING null,firstName VARCHAR(75) null,middleName VARCHAR(75) null,lastName VARCHAR(75) null,jobTitle VARCHAR(100) 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,emailAddressVerified BOOLEAN,status INTEGER)";
107            public static final String TABLE_SQL_DROP = "drop table User_";
108            public static final String DATA_SOURCE = "liferayDataSource";
109            public static final String SESSION_FACTORY = "liferaySessionFactory";
110            public static final String TX_MANAGER = "liferayTransactionManager";
111            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
112                                    "value.object.entity.cache.enabled.com.liferay.portal.model.User"),
113                            true);
114            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
115                                    "value.object.finder.cache.enabled.com.liferay.portal.model.User"),
116                            true);
117            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
118                                    "value.object.column.bitmask.enabled.com.liferay.portal.model.User"),
119                            true);
120            public static long COMPANYID_COLUMN_BITMASK = 1L;
121            public static long CONTACTID_COLUMN_BITMASK = 2L;
122            public static long CREATEDATE_COLUMN_BITMASK = 4L;
123            public static long DEFAULTUSER_COLUMN_BITMASK = 8L;
124            public static long EMAILADDRESS_COLUMN_BITMASK = 16L;
125            public static long FACEBOOKID_COLUMN_BITMASK = 32L;
126            public static long MODIFIEDDATE_COLUMN_BITMASK = 64L;
127            public static long OPENID_COLUMN_BITMASK = 128L;
128            public static long PORTRAITID_COLUMN_BITMASK = 256L;
129            public static long SCREENNAME_COLUMN_BITMASK = 512L;
130            public static long STATUS_COLUMN_BITMASK = 1024L;
131            public static long USERID_COLUMN_BITMASK = 2048L;
132            public static long UUID_COLUMN_BITMASK = 4096L;
133    
134            /**
135             * Converts the soap model instance into a normal model instance.
136             *
137             * @param soapModel the soap model instance to convert
138             * @return the normal model instance
139             */
140            public static User toModel(UserSoap soapModel) {
141                    if (soapModel == null) {
142                            return null;
143                    }
144    
145                    User model = new UserImpl();
146    
147                    model.setUuid(soapModel.getUuid());
148                    model.setUserId(soapModel.getUserId());
149                    model.setCompanyId(soapModel.getCompanyId());
150                    model.setCreateDate(soapModel.getCreateDate());
151                    model.setModifiedDate(soapModel.getModifiedDate());
152                    model.setDefaultUser(soapModel.getDefaultUser());
153                    model.setContactId(soapModel.getContactId());
154                    model.setPassword(soapModel.getPassword());
155                    model.setPasswordEncrypted(soapModel.getPasswordEncrypted());
156                    model.setPasswordReset(soapModel.getPasswordReset());
157                    model.setPasswordModifiedDate(soapModel.getPasswordModifiedDate());
158                    model.setDigest(soapModel.getDigest());
159                    model.setReminderQueryQuestion(soapModel.getReminderQueryQuestion());
160                    model.setReminderQueryAnswer(soapModel.getReminderQueryAnswer());
161                    model.setGraceLoginCount(soapModel.getGraceLoginCount());
162                    model.setScreenName(soapModel.getScreenName());
163                    model.setEmailAddress(soapModel.getEmailAddress());
164                    model.setFacebookId(soapModel.getFacebookId());
165                    model.setOpenId(soapModel.getOpenId());
166                    model.setPortraitId(soapModel.getPortraitId());
167                    model.setLanguageId(soapModel.getLanguageId());
168                    model.setTimeZoneId(soapModel.getTimeZoneId());
169                    model.setGreeting(soapModel.getGreeting());
170                    model.setComments(soapModel.getComments());
171                    model.setFirstName(soapModel.getFirstName());
172                    model.setMiddleName(soapModel.getMiddleName());
173                    model.setLastName(soapModel.getLastName());
174                    model.setJobTitle(soapModel.getJobTitle());
175                    model.setLoginDate(soapModel.getLoginDate());
176                    model.setLoginIP(soapModel.getLoginIP());
177                    model.setLastLoginDate(soapModel.getLastLoginDate());
178                    model.setLastLoginIP(soapModel.getLastLoginIP());
179                    model.setLastFailedLoginDate(soapModel.getLastFailedLoginDate());
180                    model.setFailedLoginAttempts(soapModel.getFailedLoginAttempts());
181                    model.setLockout(soapModel.getLockout());
182                    model.setLockoutDate(soapModel.getLockoutDate());
183                    model.setAgreedToTermsOfUse(soapModel.getAgreedToTermsOfUse());
184                    model.setEmailAddressVerified(soapModel.getEmailAddressVerified());
185                    model.setStatus(soapModel.getStatus());
186    
187                    return model;
188            }
189    
190            /**
191             * Converts the soap model instances into normal model instances.
192             *
193             * @param soapModels the soap model instances to convert
194             * @return the normal model instances
195             */
196            public static List<User> toModels(UserSoap[] soapModels) {
197                    if (soapModels == null) {
198                            return null;
199                    }
200    
201                    List<User> models = new ArrayList<User>(soapModels.length);
202    
203                    for (UserSoap soapModel : soapModels) {
204                            models.add(toModel(soapModel));
205                    }
206    
207                    return models;
208            }
209    
210            public static final String MAPPING_TABLE_USERS_GROUPS_NAME = "Users_Groups";
211            public static final Object[][] MAPPING_TABLE_USERS_GROUPS_COLUMNS = {
212                            { "userId", Types.BIGINT },
213                            { "groupId", Types.BIGINT }
214                    };
215            public static final String MAPPING_TABLE_USERS_GROUPS_SQL_CREATE = "create table Users_Groups (groupId LONG not null,userId LONG not null,primary key (groupId, userId))";
216            public static final boolean FINDER_CACHE_ENABLED_USERS_GROUPS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
217                                    "value.object.finder.cache.enabled.Users_Groups"), true);
218            public static final String MAPPING_TABLE_USERS_ORGS_NAME = "Users_Orgs";
219            public static final Object[][] MAPPING_TABLE_USERS_ORGS_COLUMNS = {
220                            { "userId", Types.BIGINT },
221                            { "organizationId", Types.BIGINT }
222                    };
223            public static final String MAPPING_TABLE_USERS_ORGS_SQL_CREATE = "create table Users_Orgs (organizationId LONG not null,userId LONG not null,primary key (organizationId, userId))";
224            public static final boolean FINDER_CACHE_ENABLED_USERS_ORGS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
225                                    "value.object.finder.cache.enabled.Users_Orgs"), true);
226            public static final String MAPPING_TABLE_USERS_PERMISSIONS_NAME = "Users_Permissions";
227            public static final Object[][] MAPPING_TABLE_USERS_PERMISSIONS_COLUMNS = {
228                            { "userId", Types.BIGINT },
229                            { "permissionId", Types.BIGINT }
230                    };
231            public static final String MAPPING_TABLE_USERS_PERMISSIONS_SQL_CREATE = "create table Users_Permissions (permissionId LONG not null,userId LONG not null,primary key (permissionId, userId))";
232            public static final boolean FINDER_CACHE_ENABLED_USERS_PERMISSIONS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
233                                    "value.object.finder.cache.enabled.Users_Permissions"), true);
234            public static final String MAPPING_TABLE_USERS_ROLES_NAME = "Users_Roles";
235            public static final Object[][] MAPPING_TABLE_USERS_ROLES_COLUMNS = {
236                            { "userId", Types.BIGINT },
237                            { "roleId", Types.BIGINT }
238                    };
239            public static final String MAPPING_TABLE_USERS_ROLES_SQL_CREATE = "create table Users_Roles (roleId LONG not null,userId LONG not null,primary key (roleId, userId))";
240            public static final boolean FINDER_CACHE_ENABLED_USERS_ROLES = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
241                                    "value.object.finder.cache.enabled.Users_Roles"), true);
242            public static final String MAPPING_TABLE_USERS_TEAMS_NAME = "Users_Teams";
243            public static final Object[][] MAPPING_TABLE_USERS_TEAMS_COLUMNS = {
244                            { "userId", Types.BIGINT },
245                            { "teamId", Types.BIGINT }
246                    };
247            public static final String MAPPING_TABLE_USERS_TEAMS_SQL_CREATE = "create table Users_Teams (teamId LONG not null,userId LONG not null,primary key (teamId, userId))";
248            public static final boolean FINDER_CACHE_ENABLED_USERS_TEAMS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
249                                    "value.object.finder.cache.enabled.Users_Teams"), true);
250            public static final String MAPPING_TABLE_USERS_USERGROUPS_NAME = "Users_UserGroups";
251            public static final Object[][] MAPPING_TABLE_USERS_USERGROUPS_COLUMNS = {
252                            { "userGroupId", Types.BIGINT },
253                            { "userId", Types.BIGINT }
254                    };
255            public static final String MAPPING_TABLE_USERS_USERGROUPS_SQL_CREATE = "create table Users_UserGroups (userId LONG not null,userGroupId LONG not null,primary key (userId, userGroupId))";
256            public static final boolean FINDER_CACHE_ENABLED_USERS_USERGROUPS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
257                                    "value.object.finder.cache.enabled.Users_UserGroups"), true);
258            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
259                                    "lock.expiration.time.com.liferay.portal.model.User"));
260    
261            public UserModelImpl() {
262            }
263    
264            public long getPrimaryKey() {
265                    return _userId;
266            }
267    
268            public void setPrimaryKey(long primaryKey) {
269                    setUserId(primaryKey);
270            }
271    
272            public Serializable getPrimaryKeyObj() {
273                    return new Long(_userId);
274            }
275    
276            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
277                    setPrimaryKey(((Long)primaryKeyObj).longValue());
278            }
279    
280            public Class<?> getModelClass() {
281                    return User.class;
282            }
283    
284            public String getModelClassName() {
285                    return User.class.getName();
286            }
287    
288            @Override
289            public Map<String, Object> getModelAttributes() {
290                    Map<String, Object> attributes = new HashMap<String, Object>();
291    
292                    attributes.put("uuid", getUuid());
293                    attributes.put("userId", getUserId());
294                    attributes.put("companyId", getCompanyId());
295                    attributes.put("createDate", getCreateDate());
296                    attributes.put("modifiedDate", getModifiedDate());
297                    attributes.put("defaultUser", getDefaultUser());
298                    attributes.put("contactId", getContactId());
299                    attributes.put("password", getPassword());
300                    attributes.put("passwordEncrypted", getPasswordEncrypted());
301                    attributes.put("passwordReset", getPasswordReset());
302                    attributes.put("passwordModifiedDate", getPasswordModifiedDate());
303                    attributes.put("digest", getDigest());
304                    attributes.put("reminderQueryQuestion", getReminderQueryQuestion());
305                    attributes.put("reminderQueryAnswer", getReminderQueryAnswer());
306                    attributes.put("graceLoginCount", getGraceLoginCount());
307                    attributes.put("screenName", getScreenName());
308                    attributes.put("emailAddress", getEmailAddress());
309                    attributes.put("facebookId", getFacebookId());
310                    attributes.put("openId", getOpenId());
311                    attributes.put("portraitId", getPortraitId());
312                    attributes.put("languageId", getLanguageId());
313                    attributes.put("timeZoneId", getTimeZoneId());
314                    attributes.put("greeting", getGreeting());
315                    attributes.put("comments", getComments());
316                    attributes.put("firstName", getFirstName());
317                    attributes.put("middleName", getMiddleName());
318                    attributes.put("lastName", getLastName());
319                    attributes.put("jobTitle", getJobTitle());
320                    attributes.put("loginDate", getLoginDate());
321                    attributes.put("loginIP", getLoginIP());
322                    attributes.put("lastLoginDate", getLastLoginDate());
323                    attributes.put("lastLoginIP", getLastLoginIP());
324                    attributes.put("lastFailedLoginDate", getLastFailedLoginDate());
325                    attributes.put("failedLoginAttempts", getFailedLoginAttempts());
326                    attributes.put("lockout", getLockout());
327                    attributes.put("lockoutDate", getLockoutDate());
328                    attributes.put("agreedToTermsOfUse", getAgreedToTermsOfUse());
329                    attributes.put("emailAddressVerified", getEmailAddressVerified());
330                    attributes.put("status", getStatus());
331    
332                    return attributes;
333            }
334    
335            @Override
336            public void setModelAttributes(Map<String, Object> attributes) {
337                    String uuid = (String)attributes.get("uuid");
338    
339                    if (uuid != null) {
340                            setUuid(uuid);
341                    }
342    
343                    Long userId = (Long)attributes.get("userId");
344    
345                    if (userId != null) {
346                            setUserId(userId);
347                    }
348    
349                    Long companyId = (Long)attributes.get("companyId");
350    
351                    if (companyId != null) {
352                            setCompanyId(companyId);
353                    }
354    
355                    Date createDate = (Date)attributes.get("createDate");
356    
357                    if (createDate != null) {
358                            setCreateDate(createDate);
359                    }
360    
361                    Date modifiedDate = (Date)attributes.get("modifiedDate");
362    
363                    if (modifiedDate != null) {
364                            setModifiedDate(modifiedDate);
365                    }
366    
367                    Boolean defaultUser = (Boolean)attributes.get("defaultUser");
368    
369                    if (defaultUser != null) {
370                            setDefaultUser(defaultUser);
371                    }
372    
373                    Long contactId = (Long)attributes.get("contactId");
374    
375                    if (contactId != null) {
376                            setContactId(contactId);
377                    }
378    
379                    String password = (String)attributes.get("password");
380    
381                    if (password != null) {
382                            setPassword(password);
383                    }
384    
385                    Boolean passwordEncrypted = (Boolean)attributes.get("passwordEncrypted");
386    
387                    if (passwordEncrypted != null) {
388                            setPasswordEncrypted(passwordEncrypted);
389                    }
390    
391                    Boolean passwordReset = (Boolean)attributes.get("passwordReset");
392    
393                    if (passwordReset != null) {
394                            setPasswordReset(passwordReset);
395                    }
396    
397                    Date passwordModifiedDate = (Date)attributes.get("passwordModifiedDate");
398    
399                    if (passwordModifiedDate != null) {
400                            setPasswordModifiedDate(passwordModifiedDate);
401                    }
402    
403                    String digest = (String)attributes.get("digest");
404    
405                    if (digest != null) {
406                            setDigest(digest);
407                    }
408    
409                    String reminderQueryQuestion = (String)attributes.get(
410                                    "reminderQueryQuestion");
411    
412                    if (reminderQueryQuestion != null) {
413                            setReminderQueryQuestion(reminderQueryQuestion);
414                    }
415    
416                    String reminderQueryAnswer = (String)attributes.get(
417                                    "reminderQueryAnswer");
418    
419                    if (reminderQueryAnswer != null) {
420                            setReminderQueryAnswer(reminderQueryAnswer);
421                    }
422    
423                    Integer graceLoginCount = (Integer)attributes.get("graceLoginCount");
424    
425                    if (graceLoginCount != null) {
426                            setGraceLoginCount(graceLoginCount);
427                    }
428    
429                    String screenName = (String)attributes.get("screenName");
430    
431                    if (screenName != null) {
432                            setScreenName(screenName);
433                    }
434    
435                    String emailAddress = (String)attributes.get("emailAddress");
436    
437                    if (emailAddress != null) {
438                            setEmailAddress(emailAddress);
439                    }
440    
441                    Long facebookId = (Long)attributes.get("facebookId");
442    
443                    if (facebookId != null) {
444                            setFacebookId(facebookId);
445                    }
446    
447                    String openId = (String)attributes.get("openId");
448    
449                    if (openId != null) {
450                            setOpenId(openId);
451                    }
452    
453                    Long portraitId = (Long)attributes.get("portraitId");
454    
455                    if (portraitId != null) {
456                            setPortraitId(portraitId);
457                    }
458    
459                    String languageId = (String)attributes.get("languageId");
460    
461                    if (languageId != null) {
462                            setLanguageId(languageId);
463                    }
464    
465                    String timeZoneId = (String)attributes.get("timeZoneId");
466    
467                    if (timeZoneId != null) {
468                            setTimeZoneId(timeZoneId);
469                    }
470    
471                    String greeting = (String)attributes.get("greeting");
472    
473                    if (greeting != null) {
474                            setGreeting(greeting);
475                    }
476    
477                    String comments = (String)attributes.get("comments");
478    
479                    if (comments != null) {
480                            setComments(comments);
481                    }
482    
483                    String firstName = (String)attributes.get("firstName");
484    
485                    if (firstName != null) {
486                            setFirstName(firstName);
487                    }
488    
489                    String middleName = (String)attributes.get("middleName");
490    
491                    if (middleName != null) {
492                            setMiddleName(middleName);
493                    }
494    
495                    String lastName = (String)attributes.get("lastName");
496    
497                    if (lastName != null) {
498                            setLastName(lastName);
499                    }
500    
501                    String jobTitle = (String)attributes.get("jobTitle");
502    
503                    if (jobTitle != null) {
504                            setJobTitle(jobTitle);
505                    }
506    
507                    Date loginDate = (Date)attributes.get("loginDate");
508    
509                    if (loginDate != null) {
510                            setLoginDate(loginDate);
511                    }
512    
513                    String loginIP = (String)attributes.get("loginIP");
514    
515                    if (loginIP != null) {
516                            setLoginIP(loginIP);
517                    }
518    
519                    Date lastLoginDate = (Date)attributes.get("lastLoginDate");
520    
521                    if (lastLoginDate != null) {
522                            setLastLoginDate(lastLoginDate);
523                    }
524    
525                    String lastLoginIP = (String)attributes.get("lastLoginIP");
526    
527                    if (lastLoginIP != null) {
528                            setLastLoginIP(lastLoginIP);
529                    }
530    
531                    Date lastFailedLoginDate = (Date)attributes.get("lastFailedLoginDate");
532    
533                    if (lastFailedLoginDate != null) {
534                            setLastFailedLoginDate(lastFailedLoginDate);
535                    }
536    
537                    Integer failedLoginAttempts = (Integer)attributes.get(
538                                    "failedLoginAttempts");
539    
540                    if (failedLoginAttempts != null) {
541                            setFailedLoginAttempts(failedLoginAttempts);
542                    }
543    
544                    Boolean lockout = (Boolean)attributes.get("lockout");
545    
546                    if (lockout != null) {
547                            setLockout(lockout);
548                    }
549    
550                    Date lockoutDate = (Date)attributes.get("lockoutDate");
551    
552                    if (lockoutDate != null) {
553                            setLockoutDate(lockoutDate);
554                    }
555    
556                    Boolean agreedToTermsOfUse = (Boolean)attributes.get(
557                                    "agreedToTermsOfUse");
558    
559                    if (agreedToTermsOfUse != null) {
560                            setAgreedToTermsOfUse(agreedToTermsOfUse);
561                    }
562    
563                    Boolean emailAddressVerified = (Boolean)attributes.get(
564                                    "emailAddressVerified");
565    
566                    if (emailAddressVerified != null) {
567                            setEmailAddressVerified(emailAddressVerified);
568                    }
569    
570                    Integer status = (Integer)attributes.get("status");
571    
572                    if (status != null) {
573                            setStatus(status);
574                    }
575            }
576    
577            @JSON
578            public String getUuid() {
579                    if (_uuid == null) {
580                            return StringPool.BLANK;
581                    }
582                    else {
583                            return _uuid;
584                    }
585            }
586    
587            public void setUuid(String uuid) {
588                    if (_originalUuid == null) {
589                            _originalUuid = _uuid;
590                    }
591    
592                    _uuid = uuid;
593            }
594    
595            public String getOriginalUuid() {
596                    return GetterUtil.getString(_originalUuid);
597            }
598    
599            @JSON
600            public long getUserId() {
601                    return _userId;
602            }
603    
604            public void setUserId(long userId) {
605                    _columnBitmask |= USERID_COLUMN_BITMASK;
606    
607                    if (!_setOriginalUserId) {
608                            _setOriginalUserId = true;
609    
610                            _originalUserId = _userId;
611                    }
612    
613                    _userId = userId;
614            }
615    
616            public String getUserUuid() throws SystemException {
617                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
618            }
619    
620            public void setUserUuid(String userUuid) {
621                    _userUuid = userUuid;
622            }
623    
624            public long getOriginalUserId() {
625                    return _originalUserId;
626            }
627    
628            @JSON
629            public long getCompanyId() {
630                    return _companyId;
631            }
632    
633            public void setCompanyId(long companyId) {
634                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
635    
636                    if (!_setOriginalCompanyId) {
637                            _setOriginalCompanyId = true;
638    
639                            _originalCompanyId = _companyId;
640                    }
641    
642                    _companyId = companyId;
643            }
644    
645            public long getOriginalCompanyId() {
646                    return _originalCompanyId;
647            }
648    
649            @JSON
650            public Date getCreateDate() {
651                    return _createDate;
652            }
653    
654            public void setCreateDate(Date createDate) {
655                    _columnBitmask |= CREATEDATE_COLUMN_BITMASK;
656    
657                    if (_originalCreateDate == null) {
658                            _originalCreateDate = _createDate;
659                    }
660    
661                    _createDate = createDate;
662            }
663    
664            public Date getOriginalCreateDate() {
665                    return _originalCreateDate;
666            }
667    
668            @JSON
669            public Date getModifiedDate() {
670                    return _modifiedDate;
671            }
672    
673            public void setModifiedDate(Date modifiedDate) {
674                    _columnBitmask |= MODIFIEDDATE_COLUMN_BITMASK;
675    
676                    if (_originalModifiedDate == null) {
677                            _originalModifiedDate = _modifiedDate;
678                    }
679    
680                    _modifiedDate = modifiedDate;
681            }
682    
683            public Date getOriginalModifiedDate() {
684                    return _originalModifiedDate;
685            }
686    
687            @JSON
688            public boolean getDefaultUser() {
689                    return _defaultUser;
690            }
691    
692            public boolean isDefaultUser() {
693                    return _defaultUser;
694            }
695    
696            public void setDefaultUser(boolean defaultUser) {
697                    _columnBitmask |= DEFAULTUSER_COLUMN_BITMASK;
698    
699                    if (!_setOriginalDefaultUser) {
700                            _setOriginalDefaultUser = true;
701    
702                            _originalDefaultUser = _defaultUser;
703                    }
704    
705                    _defaultUser = defaultUser;
706            }
707    
708            public boolean getOriginalDefaultUser() {
709                    return _originalDefaultUser;
710            }
711    
712            @JSON
713            public long getContactId() {
714                    return _contactId;
715            }
716    
717            public void setContactId(long contactId) {
718                    _columnBitmask |= CONTACTID_COLUMN_BITMASK;
719    
720                    if (!_setOriginalContactId) {
721                            _setOriginalContactId = true;
722    
723                            _originalContactId = _contactId;
724                    }
725    
726                    _contactId = contactId;
727            }
728    
729            public long getOriginalContactId() {
730                    return _originalContactId;
731            }
732    
733            @JSON(include = false)
734            public String getPassword() {
735                    if (_password == null) {
736                            return StringPool.BLANK;
737                    }
738                    else {
739                            return _password;
740                    }
741            }
742    
743            public void setPassword(String password) {
744                    _password = password;
745            }
746    
747            @JSON(include = false)
748            public boolean getPasswordEncrypted() {
749                    return _passwordEncrypted;
750            }
751    
752            public boolean isPasswordEncrypted() {
753                    return _passwordEncrypted;
754            }
755    
756            public void setPasswordEncrypted(boolean passwordEncrypted) {
757                    _passwordEncrypted = passwordEncrypted;
758            }
759    
760            @JSON(include = false)
761            public boolean getPasswordReset() {
762                    return _passwordReset;
763            }
764    
765            public boolean isPasswordReset() {
766                    return _passwordReset;
767            }
768    
769            public void setPasswordReset(boolean passwordReset) {
770                    _passwordReset = passwordReset;
771            }
772    
773            @JSON(include = false)
774            public Date getPasswordModifiedDate() {
775                    return _passwordModifiedDate;
776            }
777    
778            public void setPasswordModifiedDate(Date passwordModifiedDate) {
779                    _passwordModifiedDate = passwordModifiedDate;
780            }
781    
782            @JSON(include = false)
783            public String getDigest() {
784                    if (_digest == null) {
785                            return StringPool.BLANK;
786                    }
787                    else {
788                            return _digest;
789                    }
790            }
791    
792            public void setDigest(String digest) {
793                    _digest = digest;
794            }
795    
796            @JSON
797            public String getReminderQueryQuestion() {
798                    if (_reminderQueryQuestion == null) {
799                            return StringPool.BLANK;
800                    }
801                    else {
802                            return _reminderQueryQuestion;
803                    }
804            }
805    
806            public void setReminderQueryQuestion(String reminderQueryQuestion) {
807                    _reminderQueryQuestion = reminderQueryQuestion;
808            }
809    
810            @JSON
811            public String getReminderQueryAnswer() {
812                    if (_reminderQueryAnswer == null) {
813                            return StringPool.BLANK;
814                    }
815                    else {
816                            return _reminderQueryAnswer;
817                    }
818            }
819    
820            public void setReminderQueryAnswer(String reminderQueryAnswer) {
821                    _reminderQueryAnswer = reminderQueryAnswer;
822            }
823    
824            @JSON
825            public int getGraceLoginCount() {
826                    return _graceLoginCount;
827            }
828    
829            public void setGraceLoginCount(int graceLoginCount) {
830                    _graceLoginCount = graceLoginCount;
831            }
832    
833            @JSON
834            public String getScreenName() {
835                    if (_screenName == null) {
836                            return StringPool.BLANK;
837                    }
838                    else {
839                            return _screenName;
840                    }
841            }
842    
843            public void setScreenName(String screenName) {
844                    _columnBitmask |= SCREENNAME_COLUMN_BITMASK;
845    
846                    if (_originalScreenName == null) {
847                            _originalScreenName = _screenName;
848                    }
849    
850                    _screenName = screenName;
851            }
852    
853            public String getOriginalScreenName() {
854                    return GetterUtil.getString(_originalScreenName);
855            }
856    
857            @JSON
858            public String getEmailAddress() {
859                    if (_emailAddress == null) {
860                            return StringPool.BLANK;
861                    }
862                    else {
863                            return _emailAddress;
864                    }
865            }
866    
867            public void setEmailAddress(String emailAddress) {
868                    _columnBitmask |= EMAILADDRESS_COLUMN_BITMASK;
869    
870                    if (_originalEmailAddress == null) {
871                            _originalEmailAddress = _emailAddress;
872                    }
873    
874                    _emailAddress = emailAddress;
875            }
876    
877            public String getOriginalEmailAddress() {
878                    return GetterUtil.getString(_originalEmailAddress);
879            }
880    
881            @JSON
882            public long getFacebookId() {
883                    return _facebookId;
884            }
885    
886            public void setFacebookId(long facebookId) {
887                    _columnBitmask |= FACEBOOKID_COLUMN_BITMASK;
888    
889                    if (!_setOriginalFacebookId) {
890                            _setOriginalFacebookId = true;
891    
892                            _originalFacebookId = _facebookId;
893                    }
894    
895                    _facebookId = facebookId;
896            }
897    
898            public long getOriginalFacebookId() {
899                    return _originalFacebookId;
900            }
901    
902            @JSON
903            public String getOpenId() {
904                    if (_openId == null) {
905                            return StringPool.BLANK;
906                    }
907                    else {
908                            return _openId;
909                    }
910            }
911    
912            public void setOpenId(String openId) {
913                    _columnBitmask |= OPENID_COLUMN_BITMASK;
914    
915                    if (_originalOpenId == null) {
916                            _originalOpenId = _openId;
917                    }
918    
919                    _openId = openId;
920            }
921    
922            public String getOriginalOpenId() {
923                    return GetterUtil.getString(_originalOpenId);
924            }
925    
926            @JSON
927            public long getPortraitId() {
928                    return _portraitId;
929            }
930    
931            public void setPortraitId(long portraitId) {
932                    _columnBitmask |= PORTRAITID_COLUMN_BITMASK;
933    
934                    if (!_setOriginalPortraitId) {
935                            _setOriginalPortraitId = true;
936    
937                            _originalPortraitId = _portraitId;
938                    }
939    
940                    _portraitId = portraitId;
941            }
942    
943            public long getOriginalPortraitId() {
944                    return _originalPortraitId;
945            }
946    
947            @JSON
948            public String getLanguageId() {
949                    if (_languageId == null) {
950                            return StringPool.BLANK;
951                    }
952                    else {
953                            return _languageId;
954                    }
955            }
956    
957            public void setLanguageId(String languageId) {
958                    _languageId = languageId;
959            }
960    
961            @JSON
962            public String getTimeZoneId() {
963                    if (_timeZoneId == null) {
964                            return StringPool.BLANK;
965                    }
966                    else {
967                            return _timeZoneId;
968                    }
969            }
970    
971            public void setTimeZoneId(String timeZoneId) {
972                    _timeZoneId = timeZoneId;
973            }
974    
975            @JSON
976            public String getGreeting() {
977                    if (_greeting == null) {
978                            return StringPool.BLANK;
979                    }
980                    else {
981                            return _greeting;
982                    }
983            }
984    
985            public void setGreeting(String greeting) {
986                    _greeting = greeting;
987            }
988    
989            @JSON
990            public String getComments() {
991                    if (_comments == null) {
992                            return StringPool.BLANK;
993                    }
994                    else {
995                            return _comments;
996                    }
997            }
998    
999            public void setComments(String comments) {
1000                    _comments = comments;
1001            }
1002    
1003            @JSON
1004            public String getFirstName() {
1005                    if (_firstName == null) {
1006                            return StringPool.BLANK;
1007                    }
1008                    else {
1009                            return _firstName;
1010                    }
1011            }
1012    
1013            public void setFirstName(String firstName) {
1014                    _firstName = firstName;
1015            }
1016    
1017            @JSON
1018            public String getMiddleName() {
1019                    if (_middleName == null) {
1020                            return StringPool.BLANK;
1021                    }
1022                    else {
1023                            return _middleName;
1024                    }
1025            }
1026    
1027            public void setMiddleName(String middleName) {
1028                    _middleName = middleName;
1029            }
1030    
1031            @JSON
1032            public String getLastName() {
1033                    if (_lastName == null) {
1034                            return StringPool.BLANK;
1035                    }
1036                    else {
1037                            return _lastName;
1038                    }
1039            }
1040    
1041            public void setLastName(String lastName) {
1042                    _lastName = lastName;
1043            }
1044    
1045            @JSON
1046            public String getJobTitle() {
1047                    if (_jobTitle == null) {
1048                            return StringPool.BLANK;
1049                    }
1050                    else {
1051                            return _jobTitle;
1052                    }
1053            }
1054    
1055            public void setJobTitle(String jobTitle) {
1056                    _jobTitle = jobTitle;
1057            }
1058    
1059            @JSON
1060            public Date getLoginDate() {
1061                    return _loginDate;
1062            }
1063    
1064            public void setLoginDate(Date loginDate) {
1065                    _loginDate = loginDate;
1066            }
1067    
1068            @JSON
1069            public String getLoginIP() {
1070                    if (_loginIP == null) {
1071                            return StringPool.BLANK;
1072                    }
1073                    else {
1074                            return _loginIP;
1075                    }
1076            }
1077    
1078            public void setLoginIP(String loginIP) {
1079                    _loginIP = loginIP;
1080            }
1081    
1082            @JSON
1083            public Date getLastLoginDate() {
1084                    return _lastLoginDate;
1085            }
1086    
1087            public void setLastLoginDate(Date lastLoginDate) {
1088                    _lastLoginDate = lastLoginDate;
1089            }
1090    
1091            @JSON
1092            public String getLastLoginIP() {
1093                    if (_lastLoginIP == null) {
1094                            return StringPool.BLANK;
1095                    }
1096                    else {
1097                            return _lastLoginIP;
1098                    }
1099            }
1100    
1101            public void setLastLoginIP(String lastLoginIP) {
1102                    _lastLoginIP = lastLoginIP;
1103            }
1104    
1105            @JSON
1106            public Date getLastFailedLoginDate() {
1107                    return _lastFailedLoginDate;
1108            }
1109    
1110            public void setLastFailedLoginDate(Date lastFailedLoginDate) {
1111                    _lastFailedLoginDate = lastFailedLoginDate;
1112            }
1113    
1114            @JSON
1115            public int getFailedLoginAttempts() {
1116                    return _failedLoginAttempts;
1117            }
1118    
1119            public void setFailedLoginAttempts(int failedLoginAttempts) {
1120                    _failedLoginAttempts = failedLoginAttempts;
1121            }
1122    
1123            @JSON
1124            public boolean getLockout() {
1125                    return _lockout;
1126            }
1127    
1128            public boolean isLockout() {
1129                    return _lockout;
1130            }
1131    
1132            public void setLockout(boolean lockout) {
1133                    _lockout = lockout;
1134            }
1135    
1136            @JSON
1137            public Date getLockoutDate() {
1138                    return _lockoutDate;
1139            }
1140    
1141            public void setLockoutDate(Date lockoutDate) {
1142                    _lockoutDate = lockoutDate;
1143            }
1144    
1145            @JSON
1146            public boolean getAgreedToTermsOfUse() {
1147                    return _agreedToTermsOfUse;
1148            }
1149    
1150            public boolean isAgreedToTermsOfUse() {
1151                    return _agreedToTermsOfUse;
1152            }
1153    
1154            public void setAgreedToTermsOfUse(boolean agreedToTermsOfUse) {
1155                    _agreedToTermsOfUse = agreedToTermsOfUse;
1156            }
1157    
1158            @JSON
1159            public boolean getEmailAddressVerified() {
1160                    return _emailAddressVerified;
1161            }
1162    
1163            public boolean isEmailAddressVerified() {
1164                    return _emailAddressVerified;
1165            }
1166    
1167            public void setEmailAddressVerified(boolean emailAddressVerified) {
1168                    _emailAddressVerified = emailAddressVerified;
1169            }
1170    
1171            @JSON
1172            public int getStatus() {
1173                    return _status;
1174            }
1175    
1176            public void setStatus(int status) {
1177                    _columnBitmask |= STATUS_COLUMN_BITMASK;
1178    
1179                    if (!_setOriginalStatus) {
1180                            _setOriginalStatus = true;
1181    
1182                            _originalStatus = _status;
1183                    }
1184    
1185                    _status = status;
1186            }
1187    
1188            public int getOriginalStatus() {
1189                    return _originalStatus;
1190            }
1191    
1192            public long getColumnBitmask() {
1193                    return _columnBitmask;
1194            }
1195    
1196            @Override
1197            public ExpandoBridge getExpandoBridge() {
1198                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
1199                            User.class.getName(), getPrimaryKey());
1200            }
1201    
1202            @Override
1203            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
1204                    ExpandoBridge expandoBridge = getExpandoBridge();
1205    
1206                    expandoBridge.setAttributes(serviceContext);
1207            }
1208    
1209            @Override
1210            public User toEscapedModel() {
1211                    if (_escapedModel == null) {
1212                            _escapedModel = (User)ProxyUtil.newProxyInstance(_classLoader,
1213                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
1214                    }
1215    
1216                    return _escapedModel;
1217            }
1218    
1219            public User toUnescapedModel() {
1220                    return (User)this;
1221            }
1222    
1223            @Override
1224            public Object clone() {
1225                    UserImpl userImpl = new UserImpl();
1226    
1227                    userImpl.setUuid(getUuid());
1228                    userImpl.setUserId(getUserId());
1229                    userImpl.setCompanyId(getCompanyId());
1230                    userImpl.setCreateDate(getCreateDate());
1231                    userImpl.setModifiedDate(getModifiedDate());
1232                    userImpl.setDefaultUser(getDefaultUser());
1233                    userImpl.setContactId(getContactId());
1234                    userImpl.setPassword(getPassword());
1235                    userImpl.setPasswordEncrypted(getPasswordEncrypted());
1236                    userImpl.setPasswordReset(getPasswordReset());
1237                    userImpl.setPasswordModifiedDate(getPasswordModifiedDate());
1238                    userImpl.setDigest(getDigest());
1239                    userImpl.setReminderQueryQuestion(getReminderQueryQuestion());
1240                    userImpl.setReminderQueryAnswer(getReminderQueryAnswer());
1241                    userImpl.setGraceLoginCount(getGraceLoginCount());
1242                    userImpl.setScreenName(getScreenName());
1243                    userImpl.setEmailAddress(getEmailAddress());
1244                    userImpl.setFacebookId(getFacebookId());
1245                    userImpl.setOpenId(getOpenId());
1246                    userImpl.setPortraitId(getPortraitId());
1247                    userImpl.setLanguageId(getLanguageId());
1248                    userImpl.setTimeZoneId(getTimeZoneId());
1249                    userImpl.setGreeting(getGreeting());
1250                    userImpl.setComments(getComments());
1251                    userImpl.setFirstName(getFirstName());
1252                    userImpl.setMiddleName(getMiddleName());
1253                    userImpl.setLastName(getLastName());
1254                    userImpl.setJobTitle(getJobTitle());
1255                    userImpl.setLoginDate(getLoginDate());
1256                    userImpl.setLoginIP(getLoginIP());
1257                    userImpl.setLastLoginDate(getLastLoginDate());
1258                    userImpl.setLastLoginIP(getLastLoginIP());
1259                    userImpl.setLastFailedLoginDate(getLastFailedLoginDate());
1260                    userImpl.setFailedLoginAttempts(getFailedLoginAttempts());
1261                    userImpl.setLockout(getLockout());
1262                    userImpl.setLockoutDate(getLockoutDate());
1263                    userImpl.setAgreedToTermsOfUse(getAgreedToTermsOfUse());
1264                    userImpl.setEmailAddressVerified(getEmailAddressVerified());
1265                    userImpl.setStatus(getStatus());
1266    
1267                    userImpl.resetOriginalValues();
1268    
1269                    return userImpl;
1270            }
1271    
1272            public int compareTo(User user) {
1273                    long primaryKey = user.getPrimaryKey();
1274    
1275                    if (getPrimaryKey() < primaryKey) {
1276                            return -1;
1277                    }
1278                    else if (getPrimaryKey() > primaryKey) {
1279                            return 1;
1280                    }
1281                    else {
1282                            return 0;
1283                    }
1284            }
1285    
1286            @Override
1287            public boolean equals(Object obj) {
1288                    if (this == obj) {
1289                            return true;
1290                    }
1291    
1292                    if (!(obj instanceof User)) {
1293                            return false;
1294                    }
1295    
1296                    User user = (User)obj;
1297    
1298                    long primaryKey = user.getPrimaryKey();
1299    
1300                    if (getPrimaryKey() == primaryKey) {
1301                            return true;
1302                    }
1303                    else {
1304                            return false;
1305                    }
1306            }
1307    
1308            @Override
1309            public int hashCode() {
1310                    return (int)getPrimaryKey();
1311            }
1312    
1313            @Override
1314            public void resetOriginalValues() {
1315                    UserModelImpl userModelImpl = this;
1316    
1317                    userModelImpl._originalUuid = userModelImpl._uuid;
1318    
1319                    userModelImpl._originalUserId = userModelImpl._userId;
1320    
1321                    userModelImpl._setOriginalUserId = false;
1322    
1323                    userModelImpl._originalCompanyId = userModelImpl._companyId;
1324    
1325                    userModelImpl._setOriginalCompanyId = false;
1326    
1327                    userModelImpl._originalCreateDate = userModelImpl._createDate;
1328    
1329                    userModelImpl._originalModifiedDate = userModelImpl._modifiedDate;
1330    
1331                    userModelImpl._originalDefaultUser = userModelImpl._defaultUser;
1332    
1333                    userModelImpl._setOriginalDefaultUser = false;
1334    
1335                    userModelImpl._originalContactId = userModelImpl._contactId;
1336    
1337                    userModelImpl._setOriginalContactId = false;
1338    
1339                    userModelImpl._originalScreenName = userModelImpl._screenName;
1340    
1341                    userModelImpl._originalEmailAddress = userModelImpl._emailAddress;
1342    
1343                    userModelImpl._originalFacebookId = userModelImpl._facebookId;
1344    
1345                    userModelImpl._setOriginalFacebookId = false;
1346    
1347                    userModelImpl._originalOpenId = userModelImpl._openId;
1348    
1349                    userModelImpl._originalPortraitId = userModelImpl._portraitId;
1350    
1351                    userModelImpl._setOriginalPortraitId = false;
1352    
1353                    userModelImpl._originalStatus = userModelImpl._status;
1354    
1355                    userModelImpl._setOriginalStatus = false;
1356    
1357                    userModelImpl._columnBitmask = 0;
1358            }
1359    
1360            @Override
1361            public CacheModel<User> toCacheModel() {
1362                    UserCacheModel userCacheModel = new UserCacheModel();
1363    
1364                    userCacheModel.uuid = getUuid();
1365    
1366                    String uuid = userCacheModel.uuid;
1367    
1368                    if ((uuid != null) && (uuid.length() == 0)) {
1369                            userCacheModel.uuid = null;
1370                    }
1371    
1372                    userCacheModel.userId = getUserId();
1373    
1374                    userCacheModel.companyId = getCompanyId();
1375    
1376                    Date createDate = getCreateDate();
1377    
1378                    if (createDate != null) {
1379                            userCacheModel.createDate = createDate.getTime();
1380                    }
1381                    else {
1382                            userCacheModel.createDate = Long.MIN_VALUE;
1383                    }
1384    
1385                    Date modifiedDate = getModifiedDate();
1386    
1387                    if (modifiedDate != null) {
1388                            userCacheModel.modifiedDate = modifiedDate.getTime();
1389                    }
1390                    else {
1391                            userCacheModel.modifiedDate = Long.MIN_VALUE;
1392                    }
1393    
1394                    userCacheModel.defaultUser = getDefaultUser();
1395    
1396                    userCacheModel.contactId = getContactId();
1397    
1398                    userCacheModel.password = getPassword();
1399    
1400                    String password = userCacheModel.password;
1401    
1402                    if ((password != null) && (password.length() == 0)) {
1403                            userCacheModel.password = null;
1404                    }
1405    
1406                    userCacheModel.passwordEncrypted = getPasswordEncrypted();
1407    
1408                    userCacheModel.passwordReset = getPasswordReset();
1409    
1410                    Date passwordModifiedDate = getPasswordModifiedDate();
1411    
1412                    if (passwordModifiedDate != null) {
1413                            userCacheModel.passwordModifiedDate = passwordModifiedDate.getTime();
1414                    }
1415                    else {
1416                            userCacheModel.passwordModifiedDate = Long.MIN_VALUE;
1417                    }
1418    
1419                    userCacheModel.digest = getDigest();
1420    
1421                    String digest = userCacheModel.digest;
1422    
1423                    if ((digest != null) && (digest.length() == 0)) {
1424                            userCacheModel.digest = null;
1425                    }
1426    
1427                    userCacheModel.reminderQueryQuestion = getReminderQueryQuestion();
1428    
1429                    String reminderQueryQuestion = userCacheModel.reminderQueryQuestion;
1430    
1431                    if ((reminderQueryQuestion != null) &&
1432                                    (reminderQueryQuestion.length() == 0)) {
1433                            userCacheModel.reminderQueryQuestion = null;
1434                    }
1435    
1436                    userCacheModel.reminderQueryAnswer = getReminderQueryAnswer();
1437    
1438                    String reminderQueryAnswer = userCacheModel.reminderQueryAnswer;
1439    
1440                    if ((reminderQueryAnswer != null) &&
1441                                    (reminderQueryAnswer.length() == 0)) {
1442                            userCacheModel.reminderQueryAnswer = null;
1443                    }
1444    
1445                    userCacheModel.graceLoginCount = getGraceLoginCount();
1446    
1447                    userCacheModel.screenName = getScreenName();
1448    
1449                    String screenName = userCacheModel.screenName;
1450    
1451                    if ((screenName != null) && (screenName.length() == 0)) {
1452                            userCacheModel.screenName = null;
1453                    }
1454    
1455                    userCacheModel.emailAddress = getEmailAddress();
1456    
1457                    String emailAddress = userCacheModel.emailAddress;
1458    
1459                    if ((emailAddress != null) && (emailAddress.length() == 0)) {
1460                            userCacheModel.emailAddress = null;
1461                    }
1462    
1463                    userCacheModel.facebookId = getFacebookId();
1464    
1465                    userCacheModel.openId = getOpenId();
1466    
1467                    String openId = userCacheModel.openId;
1468    
1469                    if ((openId != null) && (openId.length() == 0)) {
1470                            userCacheModel.openId = null;
1471                    }
1472    
1473                    userCacheModel.portraitId = getPortraitId();
1474    
1475                    userCacheModel.languageId = getLanguageId();
1476    
1477                    String languageId = userCacheModel.languageId;
1478    
1479                    if ((languageId != null) && (languageId.length() == 0)) {
1480                            userCacheModel.languageId = null;
1481                    }
1482    
1483                    userCacheModel.timeZoneId = getTimeZoneId();
1484    
1485                    String timeZoneId = userCacheModel.timeZoneId;
1486    
1487                    if ((timeZoneId != null) && (timeZoneId.length() == 0)) {
1488                            userCacheModel.timeZoneId = null;
1489                    }
1490    
1491                    userCacheModel.greeting = getGreeting();
1492    
1493                    String greeting = userCacheModel.greeting;
1494    
1495                    if ((greeting != null) && (greeting.length() == 0)) {
1496                            userCacheModel.greeting = null;
1497                    }
1498    
1499                    userCacheModel.comments = getComments();
1500    
1501                    String comments = userCacheModel.comments;
1502    
1503                    if ((comments != null) && (comments.length() == 0)) {
1504                            userCacheModel.comments = null;
1505                    }
1506    
1507                    userCacheModel.firstName = getFirstName();
1508    
1509                    String firstName = userCacheModel.firstName;
1510    
1511                    if ((firstName != null) && (firstName.length() == 0)) {
1512                            userCacheModel.firstName = null;
1513                    }
1514    
1515                    userCacheModel.middleName = getMiddleName();
1516    
1517                    String middleName = userCacheModel.middleName;
1518    
1519                    if ((middleName != null) && (middleName.length() == 0)) {
1520                            userCacheModel.middleName = null;
1521                    }
1522    
1523                    userCacheModel.lastName = getLastName();
1524    
1525                    String lastName = userCacheModel.lastName;
1526    
1527                    if ((lastName != null) && (lastName.length() == 0)) {
1528                            userCacheModel.lastName = null;
1529                    }
1530    
1531                    userCacheModel.jobTitle = getJobTitle();
1532    
1533                    String jobTitle = userCacheModel.jobTitle;
1534    
1535                    if ((jobTitle != null) && (jobTitle.length() == 0)) {
1536                            userCacheModel.jobTitle = null;
1537                    }
1538    
1539                    Date loginDate = getLoginDate();
1540    
1541                    if (loginDate != null) {
1542                            userCacheModel.loginDate = loginDate.getTime();
1543                    }
1544                    else {
1545                            userCacheModel.loginDate = Long.MIN_VALUE;
1546                    }
1547    
1548                    userCacheModel.loginIP = getLoginIP();
1549    
1550                    String loginIP = userCacheModel.loginIP;
1551    
1552                    if ((loginIP != null) && (loginIP.length() == 0)) {
1553                            userCacheModel.loginIP = null;
1554                    }
1555    
1556                    Date lastLoginDate = getLastLoginDate();
1557    
1558                    if (lastLoginDate != null) {
1559                            userCacheModel.lastLoginDate = lastLoginDate.getTime();
1560                    }
1561                    else {
1562                            userCacheModel.lastLoginDate = Long.MIN_VALUE;
1563                    }
1564    
1565                    userCacheModel.lastLoginIP = getLastLoginIP();
1566    
1567                    String lastLoginIP = userCacheModel.lastLoginIP;
1568    
1569                    if ((lastLoginIP != null) && (lastLoginIP.length() == 0)) {
1570                            userCacheModel.lastLoginIP = null;
1571                    }
1572    
1573                    Date lastFailedLoginDate = getLastFailedLoginDate();
1574    
1575                    if (lastFailedLoginDate != null) {
1576                            userCacheModel.lastFailedLoginDate = lastFailedLoginDate.getTime();
1577                    }
1578                    else {
1579                            userCacheModel.lastFailedLoginDate = Long.MIN_VALUE;
1580                    }
1581    
1582                    userCacheModel.failedLoginAttempts = getFailedLoginAttempts();
1583    
1584                    userCacheModel.lockout = getLockout();
1585    
1586                    Date lockoutDate = getLockoutDate();
1587    
1588                    if (lockoutDate != null) {
1589                            userCacheModel.lockoutDate = lockoutDate.getTime();
1590                    }
1591                    else {
1592                            userCacheModel.lockoutDate = Long.MIN_VALUE;
1593                    }
1594    
1595                    userCacheModel.agreedToTermsOfUse = getAgreedToTermsOfUse();
1596    
1597                    userCacheModel.emailAddressVerified = getEmailAddressVerified();
1598    
1599                    userCacheModel.status = getStatus();
1600    
1601                    return userCacheModel;
1602            }
1603    
1604            @Override
1605            public String toString() {
1606                    StringBundler sb = new StringBundler(79);
1607    
1608                    sb.append("{uuid=");
1609                    sb.append(getUuid());
1610                    sb.append(", userId=");
1611                    sb.append(getUserId());
1612                    sb.append(", companyId=");
1613                    sb.append(getCompanyId());
1614                    sb.append(", createDate=");
1615                    sb.append(getCreateDate());
1616                    sb.append(", modifiedDate=");
1617                    sb.append(getModifiedDate());
1618                    sb.append(", defaultUser=");
1619                    sb.append(getDefaultUser());
1620                    sb.append(", contactId=");
1621                    sb.append(getContactId());
1622                    sb.append(", password=");
1623                    sb.append(getPassword());
1624                    sb.append(", passwordEncrypted=");
1625                    sb.append(getPasswordEncrypted());
1626                    sb.append(", passwordReset=");
1627                    sb.append(getPasswordReset());
1628                    sb.append(", passwordModifiedDate=");
1629                    sb.append(getPasswordModifiedDate());
1630                    sb.append(", digest=");
1631                    sb.append(getDigest());
1632                    sb.append(", reminderQueryQuestion=");
1633                    sb.append(getReminderQueryQuestion());
1634                    sb.append(", reminderQueryAnswer=");
1635                    sb.append(getReminderQueryAnswer());
1636                    sb.append(", graceLoginCount=");
1637                    sb.append(getGraceLoginCount());
1638                    sb.append(", screenName=");
1639                    sb.append(getScreenName());
1640                    sb.append(", emailAddress=");
1641                    sb.append(getEmailAddress());
1642                    sb.append(", facebookId=");
1643                    sb.append(getFacebookId());
1644                    sb.append(", openId=");
1645                    sb.append(getOpenId());
1646                    sb.append(", portraitId=");
1647                    sb.append(getPortraitId());
1648                    sb.append(", languageId=");
1649                    sb.append(getLanguageId());
1650                    sb.append(", timeZoneId=");
1651                    sb.append(getTimeZoneId());
1652                    sb.append(", greeting=");
1653                    sb.append(getGreeting());
1654                    sb.append(", comments=");
1655                    sb.append(getComments());
1656                    sb.append(", firstName=");
1657                    sb.append(getFirstName());
1658                    sb.append(", middleName=");
1659                    sb.append(getMiddleName());
1660                    sb.append(", lastName=");
1661                    sb.append(getLastName());
1662                    sb.append(", jobTitle=");
1663                    sb.append(getJobTitle());
1664                    sb.append(", loginDate=");
1665                    sb.append(getLoginDate());
1666                    sb.append(", loginIP=");
1667                    sb.append(getLoginIP());
1668                    sb.append(", lastLoginDate=");
1669                    sb.append(getLastLoginDate());
1670                    sb.append(", lastLoginIP=");
1671                    sb.append(getLastLoginIP());
1672                    sb.append(", lastFailedLoginDate=");
1673                    sb.append(getLastFailedLoginDate());
1674                    sb.append(", failedLoginAttempts=");
1675                    sb.append(getFailedLoginAttempts());
1676                    sb.append(", lockout=");
1677                    sb.append(getLockout());
1678                    sb.append(", lockoutDate=");
1679                    sb.append(getLockoutDate());
1680                    sb.append(", agreedToTermsOfUse=");
1681                    sb.append(getAgreedToTermsOfUse());
1682                    sb.append(", emailAddressVerified=");
1683                    sb.append(getEmailAddressVerified());
1684                    sb.append(", status=");
1685                    sb.append(getStatus());
1686                    sb.append("}");
1687    
1688                    return sb.toString();
1689            }
1690    
1691            public String toXmlString() {
1692                    StringBundler sb = new StringBundler(121);
1693    
1694                    sb.append("<model><model-name>");
1695                    sb.append("com.liferay.portal.model.User");
1696                    sb.append("</model-name>");
1697    
1698                    sb.append(
1699                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1700                    sb.append(getUuid());
1701                    sb.append("]]></column-value></column>");
1702                    sb.append(
1703                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1704                    sb.append(getUserId());
1705                    sb.append("]]></column-value></column>");
1706                    sb.append(
1707                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1708                    sb.append(getCompanyId());
1709                    sb.append("]]></column-value></column>");
1710                    sb.append(
1711                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1712                    sb.append(getCreateDate());
1713                    sb.append("]]></column-value></column>");
1714                    sb.append(
1715                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1716                    sb.append(getModifiedDate());
1717                    sb.append("]]></column-value></column>");
1718                    sb.append(
1719                            "<column><column-name>defaultUser</column-name><column-value><![CDATA[");
1720                    sb.append(getDefaultUser());
1721                    sb.append("]]></column-value></column>");
1722                    sb.append(
1723                            "<column><column-name>contactId</column-name><column-value><![CDATA[");
1724                    sb.append(getContactId());
1725                    sb.append("]]></column-value></column>");
1726                    sb.append(
1727                            "<column><column-name>password</column-name><column-value><![CDATA[");
1728                    sb.append(getPassword());
1729                    sb.append("]]></column-value></column>");
1730                    sb.append(
1731                            "<column><column-name>passwordEncrypted</column-name><column-value><![CDATA[");
1732                    sb.append(getPasswordEncrypted());
1733                    sb.append("]]></column-value></column>");
1734                    sb.append(
1735                            "<column><column-name>passwordReset</column-name><column-value><![CDATA[");
1736                    sb.append(getPasswordReset());
1737                    sb.append("]]></column-value></column>");
1738                    sb.append(
1739                            "<column><column-name>passwordModifiedDate</column-name><column-value><![CDATA[");
1740                    sb.append(getPasswordModifiedDate());
1741                    sb.append("]]></column-value></column>");
1742                    sb.append(
1743                            "<column><column-name>digest</column-name><column-value><![CDATA[");
1744                    sb.append(getDigest());
1745                    sb.append("]]></column-value></column>");
1746                    sb.append(
1747                            "<column><column-name>reminderQueryQuestion</column-name><column-value><![CDATA[");
1748                    sb.append(getReminderQueryQuestion());
1749                    sb.append("]]></column-value></column>");
1750                    sb.append(
1751                            "<column><column-name>reminderQueryAnswer</column-name><column-value><![CDATA[");
1752                    sb.append(getReminderQueryAnswer());
1753                    sb.append("]]></column-value></column>");
1754                    sb.append(
1755                            "<column><column-name>graceLoginCount</column-name><column-value><![CDATA[");
1756                    sb.append(getGraceLoginCount());
1757                    sb.append("]]></column-value></column>");
1758                    sb.append(
1759                            "<column><column-name>screenName</column-name><column-value><![CDATA[");
1760                    sb.append(getScreenName());
1761                    sb.append("]]></column-value></column>");
1762                    sb.append(
1763                            "<column><column-name>emailAddress</column-name><column-value><![CDATA[");
1764                    sb.append(getEmailAddress());
1765                    sb.append("]]></column-value></column>");
1766                    sb.append(
1767                            "<column><column-name>facebookId</column-name><column-value><![CDATA[");
1768                    sb.append(getFacebookId());
1769                    sb.append("]]></column-value></column>");
1770                    sb.append(
1771                            "<column><column-name>openId</column-name><column-value><![CDATA[");
1772                    sb.append(getOpenId());
1773                    sb.append("]]></column-value></column>");
1774                    sb.append(
1775                            "<column><column-name>portraitId</column-name><column-value><![CDATA[");
1776                    sb.append(getPortraitId());
1777                    sb.append("]]></column-value></column>");
1778                    sb.append(
1779                            "<column><column-name>languageId</column-name><column-value><![CDATA[");
1780                    sb.append(getLanguageId());
1781                    sb.append("]]></column-value></column>");
1782                    sb.append(
1783                            "<column><column-name>timeZoneId</column-name><column-value><![CDATA[");
1784                    sb.append(getTimeZoneId());
1785                    sb.append("]]></column-value></column>");
1786                    sb.append(
1787                            "<column><column-name>greeting</column-name><column-value><![CDATA[");
1788                    sb.append(getGreeting());
1789                    sb.append("]]></column-value></column>");
1790                    sb.append(
1791                            "<column><column-name>comments</column-name><column-value><![CDATA[");
1792                    sb.append(getComments());
1793                    sb.append("]]></column-value></column>");
1794                    sb.append(
1795                            "<column><column-name>firstName</column-name><column-value><![CDATA[");
1796                    sb.append(getFirstName());
1797                    sb.append("]]></column-value></column>");
1798                    sb.append(
1799                            "<column><column-name>middleName</column-name><column-value><![CDATA[");
1800                    sb.append(getMiddleName());
1801                    sb.append("]]></column-value></column>");
1802                    sb.append(
1803                            "<column><column-name>lastName</column-name><column-value><![CDATA[");
1804                    sb.append(getLastName());
1805                    sb.append("]]></column-value></column>");
1806                    sb.append(
1807                            "<column><column-name>jobTitle</column-name><column-value><![CDATA[");
1808                    sb.append(getJobTitle());
1809                    sb.append("]]></column-value></column>");
1810                    sb.append(
1811                            "<column><column-name>loginDate</column-name><column-value><![CDATA[");
1812                    sb.append(getLoginDate());
1813                    sb.append("]]></column-value></column>");
1814                    sb.append(
1815                            "<column><column-name>loginIP</column-name><column-value><![CDATA[");
1816                    sb.append(getLoginIP());
1817                    sb.append("]]></column-value></column>");
1818                    sb.append(
1819                            "<column><column-name>lastLoginDate</column-name><column-value><![CDATA[");
1820                    sb.append(getLastLoginDate());
1821                    sb.append("]]></column-value></column>");
1822                    sb.append(
1823                            "<column><column-name>lastLoginIP</column-name><column-value><![CDATA[");
1824                    sb.append(getLastLoginIP());
1825                    sb.append("]]></column-value></column>");
1826                    sb.append(
1827                            "<column><column-name>lastFailedLoginDate</column-name><column-value><![CDATA[");
1828                    sb.append(getLastFailedLoginDate());
1829                    sb.append("]]></column-value></column>");
1830                    sb.append(
1831                            "<column><column-name>failedLoginAttempts</column-name><column-value><![CDATA[");
1832                    sb.append(getFailedLoginAttempts());
1833                    sb.append("]]></column-value></column>");
1834                    sb.append(
1835                            "<column><column-name>lockout</column-name><column-value><![CDATA[");
1836                    sb.append(getLockout());
1837                    sb.append("]]></column-value></column>");
1838                    sb.append(
1839                            "<column><column-name>lockoutDate</column-name><column-value><![CDATA[");
1840                    sb.append(getLockoutDate());
1841                    sb.append("]]></column-value></column>");
1842                    sb.append(
1843                            "<column><column-name>agreedToTermsOfUse</column-name><column-value><![CDATA[");
1844                    sb.append(getAgreedToTermsOfUse());
1845                    sb.append("]]></column-value></column>");
1846                    sb.append(
1847                            "<column><column-name>emailAddressVerified</column-name><column-value><![CDATA[");
1848                    sb.append(getEmailAddressVerified());
1849                    sb.append("]]></column-value></column>");
1850                    sb.append(
1851                            "<column><column-name>status</column-name><column-value><![CDATA[");
1852                    sb.append(getStatus());
1853                    sb.append("]]></column-value></column>");
1854    
1855                    sb.append("</model>");
1856    
1857                    return sb.toString();
1858            }
1859    
1860            private static ClassLoader _classLoader = User.class.getClassLoader();
1861            private static Class<?>[] _escapedModelInterfaces = new Class[] { User.class };
1862            private String _uuid;
1863            private String _originalUuid;
1864            private long _userId;
1865            private String _userUuid;
1866            private long _originalUserId;
1867            private boolean _setOriginalUserId;
1868            private long _companyId;
1869            private long _originalCompanyId;
1870            private boolean _setOriginalCompanyId;
1871            private Date _createDate;
1872            private Date _originalCreateDate;
1873            private Date _modifiedDate;
1874            private Date _originalModifiedDate;
1875            private boolean _defaultUser;
1876            private boolean _originalDefaultUser;
1877            private boolean _setOriginalDefaultUser;
1878            private long _contactId;
1879            private long _originalContactId;
1880            private boolean _setOriginalContactId;
1881            private String _password;
1882            private boolean _passwordEncrypted;
1883            private boolean _passwordReset;
1884            private Date _passwordModifiedDate;
1885            private String _digest;
1886            private String _reminderQueryQuestion;
1887            private String _reminderQueryAnswer;
1888            private int _graceLoginCount;
1889            private String _screenName;
1890            private String _originalScreenName;
1891            private String _emailAddress;
1892            private String _originalEmailAddress;
1893            private long _facebookId;
1894            private long _originalFacebookId;
1895            private boolean _setOriginalFacebookId;
1896            private String _openId;
1897            private String _originalOpenId;
1898            private long _portraitId;
1899            private long _originalPortraitId;
1900            private boolean _setOriginalPortraitId;
1901            private String _languageId;
1902            private String _timeZoneId;
1903            private String _greeting;
1904            private String _comments;
1905            private String _firstName;
1906            private String _middleName;
1907            private String _lastName;
1908            private String _jobTitle;
1909            private Date _loginDate;
1910            private String _loginIP;
1911            private Date _lastLoginDate;
1912            private String _lastLoginIP;
1913            private Date _lastFailedLoginDate;
1914            private int _failedLoginAttempts;
1915            private boolean _lockout;
1916            private Date _lockoutDate;
1917            private boolean _agreedToTermsOfUse;
1918            private boolean _emailAddressVerified;
1919            private int _status;
1920            private int _originalStatus;
1921            private boolean _setOriginalStatus;
1922            private long _columnBitmask;
1923            private User _escapedModel;
1924    }