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.PasswordPolicy;
026    import com.liferay.portal.model.PasswordPolicyModel;
027    import com.liferay.portal.model.PasswordPolicySoap;
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 PasswordPolicy service. Represents a row in the "PasswordPolicy" 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.PasswordPolicyModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link PasswordPolicyImpl}.
049     * </p>
050     *
051     * @author Brian Wing Shun Chan
052     * @see PasswordPolicyImpl
053     * @see com.liferay.portal.model.PasswordPolicy
054     * @see com.liferay.portal.model.PasswordPolicyModel
055     * @generated
056     */
057    @JSON(strict = true)
058    public class PasswordPolicyModelImpl extends BaseModelImpl<PasswordPolicy>
059            implements PasswordPolicyModel {
060            /*
061             * NOTE FOR DEVELOPERS:
062             *
063             * Never modify or reference this class directly. All methods that expect a password policy model instance should use the {@link com.liferay.portal.model.PasswordPolicy} interface instead.
064             */
065            public static final String TABLE_NAME = "PasswordPolicy";
066            public static final Object[][] TABLE_COLUMNS = {
067                            { "passwordPolicyId", Types.BIGINT },
068                            { "companyId", Types.BIGINT },
069                            { "userId", Types.BIGINT },
070                            { "userName", Types.VARCHAR },
071                            { "createDate", Types.TIMESTAMP },
072                            { "modifiedDate", Types.TIMESTAMP },
073                            { "defaultPolicy", Types.BOOLEAN },
074                            { "name", Types.VARCHAR },
075                            { "description", Types.VARCHAR },
076                            { "changeable", Types.BOOLEAN },
077                            { "changeRequired", Types.BOOLEAN },
078                            { "minAge", Types.BIGINT },
079                            { "checkSyntax", Types.BOOLEAN },
080                            { "allowDictionaryWords", Types.BOOLEAN },
081                            { "minAlphanumeric", Types.INTEGER },
082                            { "minLength", Types.INTEGER },
083                            { "minLowerCase", Types.INTEGER },
084                            { "minNumbers", Types.INTEGER },
085                            { "minSymbols", Types.INTEGER },
086                            { "minUpperCase", Types.INTEGER },
087                            { "history", Types.BOOLEAN },
088                            { "historyCount", Types.INTEGER },
089                            { "expireable", Types.BOOLEAN },
090                            { "maxAge", Types.BIGINT },
091                            { "warningTime", Types.BIGINT },
092                            { "graceLimit", Types.INTEGER },
093                            { "lockout", Types.BOOLEAN },
094                            { "maxFailure", Types.INTEGER },
095                            { "lockoutDuration", Types.BIGINT },
096                            { "requireUnlock", Types.BOOLEAN },
097                            { "resetFailureCount", Types.BIGINT },
098                            { "resetTicketMaxAge", Types.BIGINT }
099                    };
100            public static final String TABLE_SQL_CREATE = "create table PasswordPolicy (passwordPolicyId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,defaultPolicy BOOLEAN,name VARCHAR(75) null,description STRING null,changeable BOOLEAN,changeRequired BOOLEAN,minAge LONG,checkSyntax BOOLEAN,allowDictionaryWords BOOLEAN,minAlphanumeric INTEGER,minLength INTEGER,minLowerCase INTEGER,minNumbers INTEGER,minSymbols INTEGER,minUpperCase INTEGER,history BOOLEAN,historyCount INTEGER,expireable BOOLEAN,maxAge LONG,warningTime LONG,graceLimit INTEGER,lockout BOOLEAN,maxFailure INTEGER,lockoutDuration LONG,requireUnlock BOOLEAN,resetFailureCount LONG,resetTicketMaxAge LONG)";
101            public static final String TABLE_SQL_DROP = "drop table PasswordPolicy";
102            public static final String DATA_SOURCE = "liferayDataSource";
103            public static final String SESSION_FACTORY = "liferaySessionFactory";
104            public static final String TX_MANAGER = "liferayTransactionManager";
105            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
106                                    "value.object.entity.cache.enabled.com.liferay.portal.model.PasswordPolicy"),
107                            true);
108            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
109                                    "value.object.finder.cache.enabled.com.liferay.portal.model.PasswordPolicy"),
110                            true);
111            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
112                                    "value.object.column.bitmask.enabled.com.liferay.portal.model.PasswordPolicy"),
113                            true);
114            public static long COMPANYID_COLUMN_BITMASK = 1L;
115            public static long DEFAULTPOLICY_COLUMN_BITMASK = 2L;
116            public static long NAME_COLUMN_BITMASK = 4L;
117    
118            /**
119             * Converts the soap model instance into a normal model instance.
120             *
121             * @param soapModel the soap model instance to convert
122             * @return the normal model instance
123             */
124            public static PasswordPolicy toModel(PasswordPolicySoap soapModel) {
125                    if (soapModel == null) {
126                            return null;
127                    }
128    
129                    PasswordPolicy model = new PasswordPolicyImpl();
130    
131                    model.setPasswordPolicyId(soapModel.getPasswordPolicyId());
132                    model.setCompanyId(soapModel.getCompanyId());
133                    model.setUserId(soapModel.getUserId());
134                    model.setUserName(soapModel.getUserName());
135                    model.setCreateDate(soapModel.getCreateDate());
136                    model.setModifiedDate(soapModel.getModifiedDate());
137                    model.setDefaultPolicy(soapModel.getDefaultPolicy());
138                    model.setName(soapModel.getName());
139                    model.setDescription(soapModel.getDescription());
140                    model.setChangeable(soapModel.getChangeable());
141                    model.setChangeRequired(soapModel.getChangeRequired());
142                    model.setMinAge(soapModel.getMinAge());
143                    model.setCheckSyntax(soapModel.getCheckSyntax());
144                    model.setAllowDictionaryWords(soapModel.getAllowDictionaryWords());
145                    model.setMinAlphanumeric(soapModel.getMinAlphanumeric());
146                    model.setMinLength(soapModel.getMinLength());
147                    model.setMinLowerCase(soapModel.getMinLowerCase());
148                    model.setMinNumbers(soapModel.getMinNumbers());
149                    model.setMinSymbols(soapModel.getMinSymbols());
150                    model.setMinUpperCase(soapModel.getMinUpperCase());
151                    model.setHistory(soapModel.getHistory());
152                    model.setHistoryCount(soapModel.getHistoryCount());
153                    model.setExpireable(soapModel.getExpireable());
154                    model.setMaxAge(soapModel.getMaxAge());
155                    model.setWarningTime(soapModel.getWarningTime());
156                    model.setGraceLimit(soapModel.getGraceLimit());
157                    model.setLockout(soapModel.getLockout());
158                    model.setMaxFailure(soapModel.getMaxFailure());
159                    model.setLockoutDuration(soapModel.getLockoutDuration());
160                    model.setRequireUnlock(soapModel.getRequireUnlock());
161                    model.setResetFailureCount(soapModel.getResetFailureCount());
162                    model.setResetTicketMaxAge(soapModel.getResetTicketMaxAge());
163    
164                    return model;
165            }
166    
167            /**
168             * Converts the soap model instances into normal model instances.
169             *
170             * @param soapModels the soap model instances to convert
171             * @return the normal model instances
172             */
173            public static List<PasswordPolicy> toModels(PasswordPolicySoap[] soapModels) {
174                    if (soapModels == null) {
175                            return null;
176                    }
177    
178                    List<PasswordPolicy> models = new ArrayList<PasswordPolicy>(soapModels.length);
179    
180                    for (PasswordPolicySoap soapModel : soapModels) {
181                            models.add(toModel(soapModel));
182                    }
183    
184                    return models;
185            }
186    
187            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
188                                    "lock.expiration.time.com.liferay.portal.model.PasswordPolicy"));
189    
190            public PasswordPolicyModelImpl() {
191            }
192    
193            public long getPrimaryKey() {
194                    return _passwordPolicyId;
195            }
196    
197            public void setPrimaryKey(long primaryKey) {
198                    setPasswordPolicyId(primaryKey);
199            }
200    
201            public Serializable getPrimaryKeyObj() {
202                    return new Long(_passwordPolicyId);
203            }
204    
205            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
206                    setPrimaryKey(((Long)primaryKeyObj).longValue());
207            }
208    
209            public Class<?> getModelClass() {
210                    return PasswordPolicy.class;
211            }
212    
213            public String getModelClassName() {
214                    return PasswordPolicy.class.getName();
215            }
216    
217            @Override
218            public Map<String, Object> getModelAttributes() {
219                    Map<String, Object> attributes = new HashMap<String, Object>();
220    
221                    attributes.put("passwordPolicyId", getPasswordPolicyId());
222                    attributes.put("companyId", getCompanyId());
223                    attributes.put("userId", getUserId());
224                    attributes.put("userName", getUserName());
225                    attributes.put("createDate", getCreateDate());
226                    attributes.put("modifiedDate", getModifiedDate());
227                    attributes.put("defaultPolicy", getDefaultPolicy());
228                    attributes.put("name", getName());
229                    attributes.put("description", getDescription());
230                    attributes.put("changeable", getChangeable());
231                    attributes.put("changeRequired", getChangeRequired());
232                    attributes.put("minAge", getMinAge());
233                    attributes.put("checkSyntax", getCheckSyntax());
234                    attributes.put("allowDictionaryWords", getAllowDictionaryWords());
235                    attributes.put("minAlphanumeric", getMinAlphanumeric());
236                    attributes.put("minLength", getMinLength());
237                    attributes.put("minLowerCase", getMinLowerCase());
238                    attributes.put("minNumbers", getMinNumbers());
239                    attributes.put("minSymbols", getMinSymbols());
240                    attributes.put("minUpperCase", getMinUpperCase());
241                    attributes.put("history", getHistory());
242                    attributes.put("historyCount", getHistoryCount());
243                    attributes.put("expireable", getExpireable());
244                    attributes.put("maxAge", getMaxAge());
245                    attributes.put("warningTime", getWarningTime());
246                    attributes.put("graceLimit", getGraceLimit());
247                    attributes.put("lockout", getLockout());
248                    attributes.put("maxFailure", getMaxFailure());
249                    attributes.put("lockoutDuration", getLockoutDuration());
250                    attributes.put("requireUnlock", getRequireUnlock());
251                    attributes.put("resetFailureCount", getResetFailureCount());
252                    attributes.put("resetTicketMaxAge", getResetTicketMaxAge());
253    
254                    return attributes;
255            }
256    
257            @Override
258            public void setModelAttributes(Map<String, Object> attributes) {
259                    Long passwordPolicyId = (Long)attributes.get("passwordPolicyId");
260    
261                    if (passwordPolicyId != null) {
262                            setPasswordPolicyId(passwordPolicyId);
263                    }
264    
265                    Long companyId = (Long)attributes.get("companyId");
266    
267                    if (companyId != null) {
268                            setCompanyId(companyId);
269                    }
270    
271                    Long userId = (Long)attributes.get("userId");
272    
273                    if (userId != null) {
274                            setUserId(userId);
275                    }
276    
277                    String userName = (String)attributes.get("userName");
278    
279                    if (userName != null) {
280                            setUserName(userName);
281                    }
282    
283                    Date createDate = (Date)attributes.get("createDate");
284    
285                    if (createDate != null) {
286                            setCreateDate(createDate);
287                    }
288    
289                    Date modifiedDate = (Date)attributes.get("modifiedDate");
290    
291                    if (modifiedDate != null) {
292                            setModifiedDate(modifiedDate);
293                    }
294    
295                    Boolean defaultPolicy = (Boolean)attributes.get("defaultPolicy");
296    
297                    if (defaultPolicy != null) {
298                            setDefaultPolicy(defaultPolicy);
299                    }
300    
301                    String name = (String)attributes.get("name");
302    
303                    if (name != null) {
304                            setName(name);
305                    }
306    
307                    String description = (String)attributes.get("description");
308    
309                    if (description != null) {
310                            setDescription(description);
311                    }
312    
313                    Boolean changeable = (Boolean)attributes.get("changeable");
314    
315                    if (changeable != null) {
316                            setChangeable(changeable);
317                    }
318    
319                    Boolean changeRequired = (Boolean)attributes.get("changeRequired");
320    
321                    if (changeRequired != null) {
322                            setChangeRequired(changeRequired);
323                    }
324    
325                    Long minAge = (Long)attributes.get("minAge");
326    
327                    if (minAge != null) {
328                            setMinAge(minAge);
329                    }
330    
331                    Boolean checkSyntax = (Boolean)attributes.get("checkSyntax");
332    
333                    if (checkSyntax != null) {
334                            setCheckSyntax(checkSyntax);
335                    }
336    
337                    Boolean allowDictionaryWords = (Boolean)attributes.get(
338                                    "allowDictionaryWords");
339    
340                    if (allowDictionaryWords != null) {
341                            setAllowDictionaryWords(allowDictionaryWords);
342                    }
343    
344                    Integer minAlphanumeric = (Integer)attributes.get("minAlphanumeric");
345    
346                    if (minAlphanumeric != null) {
347                            setMinAlphanumeric(minAlphanumeric);
348                    }
349    
350                    Integer minLength = (Integer)attributes.get("minLength");
351    
352                    if (minLength != null) {
353                            setMinLength(minLength);
354                    }
355    
356                    Integer minLowerCase = (Integer)attributes.get("minLowerCase");
357    
358                    if (minLowerCase != null) {
359                            setMinLowerCase(minLowerCase);
360                    }
361    
362                    Integer minNumbers = (Integer)attributes.get("minNumbers");
363    
364                    if (minNumbers != null) {
365                            setMinNumbers(minNumbers);
366                    }
367    
368                    Integer minSymbols = (Integer)attributes.get("minSymbols");
369    
370                    if (minSymbols != null) {
371                            setMinSymbols(minSymbols);
372                    }
373    
374                    Integer minUpperCase = (Integer)attributes.get("minUpperCase");
375    
376                    if (minUpperCase != null) {
377                            setMinUpperCase(minUpperCase);
378                    }
379    
380                    Boolean history = (Boolean)attributes.get("history");
381    
382                    if (history != null) {
383                            setHistory(history);
384                    }
385    
386                    Integer historyCount = (Integer)attributes.get("historyCount");
387    
388                    if (historyCount != null) {
389                            setHistoryCount(historyCount);
390                    }
391    
392                    Boolean expireable = (Boolean)attributes.get("expireable");
393    
394                    if (expireable != null) {
395                            setExpireable(expireable);
396                    }
397    
398                    Long maxAge = (Long)attributes.get("maxAge");
399    
400                    if (maxAge != null) {
401                            setMaxAge(maxAge);
402                    }
403    
404                    Long warningTime = (Long)attributes.get("warningTime");
405    
406                    if (warningTime != null) {
407                            setWarningTime(warningTime);
408                    }
409    
410                    Integer graceLimit = (Integer)attributes.get("graceLimit");
411    
412                    if (graceLimit != null) {
413                            setGraceLimit(graceLimit);
414                    }
415    
416                    Boolean lockout = (Boolean)attributes.get("lockout");
417    
418                    if (lockout != null) {
419                            setLockout(lockout);
420                    }
421    
422                    Integer maxFailure = (Integer)attributes.get("maxFailure");
423    
424                    if (maxFailure != null) {
425                            setMaxFailure(maxFailure);
426                    }
427    
428                    Long lockoutDuration = (Long)attributes.get("lockoutDuration");
429    
430                    if (lockoutDuration != null) {
431                            setLockoutDuration(lockoutDuration);
432                    }
433    
434                    Boolean requireUnlock = (Boolean)attributes.get("requireUnlock");
435    
436                    if (requireUnlock != null) {
437                            setRequireUnlock(requireUnlock);
438                    }
439    
440                    Long resetFailureCount = (Long)attributes.get("resetFailureCount");
441    
442                    if (resetFailureCount != null) {
443                            setResetFailureCount(resetFailureCount);
444                    }
445    
446                    Long resetTicketMaxAge = (Long)attributes.get("resetTicketMaxAge");
447    
448                    if (resetTicketMaxAge != null) {
449                            setResetTicketMaxAge(resetTicketMaxAge);
450                    }
451            }
452    
453            @JSON
454            public long getPasswordPolicyId() {
455                    return _passwordPolicyId;
456            }
457    
458            public void setPasswordPolicyId(long passwordPolicyId) {
459                    _passwordPolicyId = passwordPolicyId;
460            }
461    
462            @JSON
463            public long getCompanyId() {
464                    return _companyId;
465            }
466    
467            public void setCompanyId(long companyId) {
468                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
469    
470                    if (!_setOriginalCompanyId) {
471                            _setOriginalCompanyId = true;
472    
473                            _originalCompanyId = _companyId;
474                    }
475    
476                    _companyId = companyId;
477            }
478    
479            public long getOriginalCompanyId() {
480                    return _originalCompanyId;
481            }
482    
483            @JSON
484            public long getUserId() {
485                    return _userId;
486            }
487    
488            public void setUserId(long userId) {
489                    _userId = userId;
490            }
491    
492            public String getUserUuid() throws SystemException {
493                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
494            }
495    
496            public void setUserUuid(String userUuid) {
497                    _userUuid = userUuid;
498            }
499    
500            @JSON
501            public String getUserName() {
502                    if (_userName == null) {
503                            return StringPool.BLANK;
504                    }
505                    else {
506                            return _userName;
507                    }
508            }
509    
510            public void setUserName(String userName) {
511                    _userName = userName;
512            }
513    
514            @JSON
515            public Date getCreateDate() {
516                    return _createDate;
517            }
518    
519            public void setCreateDate(Date createDate) {
520                    _createDate = createDate;
521            }
522    
523            @JSON
524            public Date getModifiedDate() {
525                    return _modifiedDate;
526            }
527    
528            public void setModifiedDate(Date modifiedDate) {
529                    _modifiedDate = modifiedDate;
530            }
531    
532            @JSON
533            public boolean getDefaultPolicy() {
534                    return _defaultPolicy;
535            }
536    
537            public boolean isDefaultPolicy() {
538                    return _defaultPolicy;
539            }
540    
541            public void setDefaultPolicy(boolean defaultPolicy) {
542                    _columnBitmask |= DEFAULTPOLICY_COLUMN_BITMASK;
543    
544                    if (!_setOriginalDefaultPolicy) {
545                            _setOriginalDefaultPolicy = true;
546    
547                            _originalDefaultPolicy = _defaultPolicy;
548                    }
549    
550                    _defaultPolicy = defaultPolicy;
551            }
552    
553            public boolean getOriginalDefaultPolicy() {
554                    return _originalDefaultPolicy;
555            }
556    
557            @JSON
558            public String getName() {
559                    if (_name == null) {
560                            return StringPool.BLANK;
561                    }
562                    else {
563                            return _name;
564                    }
565            }
566    
567            public void setName(String name) {
568                    _columnBitmask |= NAME_COLUMN_BITMASK;
569    
570                    if (_originalName == null) {
571                            _originalName = _name;
572                    }
573    
574                    _name = name;
575            }
576    
577            public String getOriginalName() {
578                    return GetterUtil.getString(_originalName);
579            }
580    
581            @JSON
582            public String getDescription() {
583                    if (_description == null) {
584                            return StringPool.BLANK;
585                    }
586                    else {
587                            return _description;
588                    }
589            }
590    
591            public void setDescription(String description) {
592                    _description = description;
593            }
594    
595            @JSON
596            public boolean getChangeable() {
597                    return _changeable;
598            }
599    
600            public boolean isChangeable() {
601                    return _changeable;
602            }
603    
604            public void setChangeable(boolean changeable) {
605                    _changeable = changeable;
606            }
607    
608            @JSON
609            public boolean getChangeRequired() {
610                    return _changeRequired;
611            }
612    
613            public boolean isChangeRequired() {
614                    return _changeRequired;
615            }
616    
617            public void setChangeRequired(boolean changeRequired) {
618                    _changeRequired = changeRequired;
619            }
620    
621            @JSON
622            public long getMinAge() {
623                    return _minAge;
624            }
625    
626            public void setMinAge(long minAge) {
627                    _minAge = minAge;
628            }
629    
630            @JSON
631            public boolean getCheckSyntax() {
632                    return _checkSyntax;
633            }
634    
635            public boolean isCheckSyntax() {
636                    return _checkSyntax;
637            }
638    
639            public void setCheckSyntax(boolean checkSyntax) {
640                    _checkSyntax = checkSyntax;
641            }
642    
643            @JSON
644            public boolean getAllowDictionaryWords() {
645                    return _allowDictionaryWords;
646            }
647    
648            public boolean isAllowDictionaryWords() {
649                    return _allowDictionaryWords;
650            }
651    
652            public void setAllowDictionaryWords(boolean allowDictionaryWords) {
653                    _allowDictionaryWords = allowDictionaryWords;
654            }
655    
656            @JSON
657            public int getMinAlphanumeric() {
658                    return _minAlphanumeric;
659            }
660    
661            public void setMinAlphanumeric(int minAlphanumeric) {
662                    _minAlphanumeric = minAlphanumeric;
663            }
664    
665            @JSON
666            public int getMinLength() {
667                    return _minLength;
668            }
669    
670            public void setMinLength(int minLength) {
671                    _minLength = minLength;
672            }
673    
674            @JSON
675            public int getMinLowerCase() {
676                    return _minLowerCase;
677            }
678    
679            public void setMinLowerCase(int minLowerCase) {
680                    _minLowerCase = minLowerCase;
681            }
682    
683            @JSON
684            public int getMinNumbers() {
685                    return _minNumbers;
686            }
687    
688            public void setMinNumbers(int minNumbers) {
689                    _minNumbers = minNumbers;
690            }
691    
692            @JSON
693            public int getMinSymbols() {
694                    return _minSymbols;
695            }
696    
697            public void setMinSymbols(int minSymbols) {
698                    _minSymbols = minSymbols;
699            }
700    
701            @JSON
702            public int getMinUpperCase() {
703                    return _minUpperCase;
704            }
705    
706            public void setMinUpperCase(int minUpperCase) {
707                    _minUpperCase = minUpperCase;
708            }
709    
710            @JSON
711            public boolean getHistory() {
712                    return _history;
713            }
714    
715            public boolean isHistory() {
716                    return _history;
717            }
718    
719            public void setHistory(boolean history) {
720                    _history = history;
721            }
722    
723            @JSON
724            public int getHistoryCount() {
725                    return _historyCount;
726            }
727    
728            public void setHistoryCount(int historyCount) {
729                    _historyCount = historyCount;
730            }
731    
732            @JSON
733            public boolean getExpireable() {
734                    return _expireable;
735            }
736    
737            public boolean isExpireable() {
738                    return _expireable;
739            }
740    
741            public void setExpireable(boolean expireable) {
742                    _expireable = expireable;
743            }
744    
745            @JSON
746            public long getMaxAge() {
747                    return _maxAge;
748            }
749    
750            public void setMaxAge(long maxAge) {
751                    _maxAge = maxAge;
752            }
753    
754            @JSON
755            public long getWarningTime() {
756                    return _warningTime;
757            }
758    
759            public void setWarningTime(long warningTime) {
760                    _warningTime = warningTime;
761            }
762    
763            @JSON
764            public int getGraceLimit() {
765                    return _graceLimit;
766            }
767    
768            public void setGraceLimit(int graceLimit) {
769                    _graceLimit = graceLimit;
770            }
771    
772            @JSON
773            public boolean getLockout() {
774                    return _lockout;
775            }
776    
777            public boolean isLockout() {
778                    return _lockout;
779            }
780    
781            public void setLockout(boolean lockout) {
782                    _lockout = lockout;
783            }
784    
785            @JSON
786            public int getMaxFailure() {
787                    return _maxFailure;
788            }
789    
790            public void setMaxFailure(int maxFailure) {
791                    _maxFailure = maxFailure;
792            }
793    
794            @JSON
795            public long getLockoutDuration() {
796                    return _lockoutDuration;
797            }
798    
799            public void setLockoutDuration(long lockoutDuration) {
800                    _lockoutDuration = lockoutDuration;
801            }
802    
803            @JSON
804            public boolean getRequireUnlock() {
805                    return _requireUnlock;
806            }
807    
808            public boolean isRequireUnlock() {
809                    return _requireUnlock;
810            }
811    
812            public void setRequireUnlock(boolean requireUnlock) {
813                    _requireUnlock = requireUnlock;
814            }
815    
816            @JSON
817            public long getResetFailureCount() {
818                    return _resetFailureCount;
819            }
820    
821            public void setResetFailureCount(long resetFailureCount) {
822                    _resetFailureCount = resetFailureCount;
823            }
824    
825            @JSON
826            public long getResetTicketMaxAge() {
827                    return _resetTicketMaxAge;
828            }
829    
830            public void setResetTicketMaxAge(long resetTicketMaxAge) {
831                    _resetTicketMaxAge = resetTicketMaxAge;
832            }
833    
834            public long getColumnBitmask() {
835                    return _columnBitmask;
836            }
837    
838            @Override
839            public ExpandoBridge getExpandoBridge() {
840                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
841                            PasswordPolicy.class.getName(), getPrimaryKey());
842            }
843    
844            @Override
845            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
846                    ExpandoBridge expandoBridge = getExpandoBridge();
847    
848                    expandoBridge.setAttributes(serviceContext);
849            }
850    
851            @Override
852            public PasswordPolicy toEscapedModel() {
853                    if (_escapedModel == null) {
854                            _escapedModel = (PasswordPolicy)ProxyUtil.newProxyInstance(_classLoader,
855                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
856                    }
857    
858                    return _escapedModel;
859            }
860    
861            public PasswordPolicy toUnescapedModel() {
862                    return (PasswordPolicy)this;
863            }
864    
865            @Override
866            public Object clone() {
867                    PasswordPolicyImpl passwordPolicyImpl = new PasswordPolicyImpl();
868    
869                    passwordPolicyImpl.setPasswordPolicyId(getPasswordPolicyId());
870                    passwordPolicyImpl.setCompanyId(getCompanyId());
871                    passwordPolicyImpl.setUserId(getUserId());
872                    passwordPolicyImpl.setUserName(getUserName());
873                    passwordPolicyImpl.setCreateDate(getCreateDate());
874                    passwordPolicyImpl.setModifiedDate(getModifiedDate());
875                    passwordPolicyImpl.setDefaultPolicy(getDefaultPolicy());
876                    passwordPolicyImpl.setName(getName());
877                    passwordPolicyImpl.setDescription(getDescription());
878                    passwordPolicyImpl.setChangeable(getChangeable());
879                    passwordPolicyImpl.setChangeRequired(getChangeRequired());
880                    passwordPolicyImpl.setMinAge(getMinAge());
881                    passwordPolicyImpl.setCheckSyntax(getCheckSyntax());
882                    passwordPolicyImpl.setAllowDictionaryWords(getAllowDictionaryWords());
883                    passwordPolicyImpl.setMinAlphanumeric(getMinAlphanumeric());
884                    passwordPolicyImpl.setMinLength(getMinLength());
885                    passwordPolicyImpl.setMinLowerCase(getMinLowerCase());
886                    passwordPolicyImpl.setMinNumbers(getMinNumbers());
887                    passwordPolicyImpl.setMinSymbols(getMinSymbols());
888                    passwordPolicyImpl.setMinUpperCase(getMinUpperCase());
889                    passwordPolicyImpl.setHistory(getHistory());
890                    passwordPolicyImpl.setHistoryCount(getHistoryCount());
891                    passwordPolicyImpl.setExpireable(getExpireable());
892                    passwordPolicyImpl.setMaxAge(getMaxAge());
893                    passwordPolicyImpl.setWarningTime(getWarningTime());
894                    passwordPolicyImpl.setGraceLimit(getGraceLimit());
895                    passwordPolicyImpl.setLockout(getLockout());
896                    passwordPolicyImpl.setMaxFailure(getMaxFailure());
897                    passwordPolicyImpl.setLockoutDuration(getLockoutDuration());
898                    passwordPolicyImpl.setRequireUnlock(getRequireUnlock());
899                    passwordPolicyImpl.setResetFailureCount(getResetFailureCount());
900                    passwordPolicyImpl.setResetTicketMaxAge(getResetTicketMaxAge());
901    
902                    passwordPolicyImpl.resetOriginalValues();
903    
904                    return passwordPolicyImpl;
905            }
906    
907            public int compareTo(PasswordPolicy passwordPolicy) {
908                    long primaryKey = passwordPolicy.getPrimaryKey();
909    
910                    if (getPrimaryKey() < primaryKey) {
911                            return -1;
912                    }
913                    else if (getPrimaryKey() > primaryKey) {
914                            return 1;
915                    }
916                    else {
917                            return 0;
918                    }
919            }
920    
921            @Override
922            public boolean equals(Object obj) {
923                    if (this == obj) {
924                            return true;
925                    }
926    
927                    if (!(obj instanceof PasswordPolicy)) {
928                            return false;
929                    }
930    
931                    PasswordPolicy passwordPolicy = (PasswordPolicy)obj;
932    
933                    long primaryKey = passwordPolicy.getPrimaryKey();
934    
935                    if (getPrimaryKey() == primaryKey) {
936                            return true;
937                    }
938                    else {
939                            return false;
940                    }
941            }
942    
943            @Override
944            public int hashCode() {
945                    return (int)getPrimaryKey();
946            }
947    
948            @Override
949            public void resetOriginalValues() {
950                    PasswordPolicyModelImpl passwordPolicyModelImpl = this;
951    
952                    passwordPolicyModelImpl._originalCompanyId = passwordPolicyModelImpl._companyId;
953    
954                    passwordPolicyModelImpl._setOriginalCompanyId = false;
955    
956                    passwordPolicyModelImpl._originalDefaultPolicy = passwordPolicyModelImpl._defaultPolicy;
957    
958                    passwordPolicyModelImpl._setOriginalDefaultPolicy = false;
959    
960                    passwordPolicyModelImpl._originalName = passwordPolicyModelImpl._name;
961    
962                    passwordPolicyModelImpl._columnBitmask = 0;
963            }
964    
965            @Override
966            public CacheModel<PasswordPolicy> toCacheModel() {
967                    PasswordPolicyCacheModel passwordPolicyCacheModel = new PasswordPolicyCacheModel();
968    
969                    passwordPolicyCacheModel.passwordPolicyId = getPasswordPolicyId();
970    
971                    passwordPolicyCacheModel.companyId = getCompanyId();
972    
973                    passwordPolicyCacheModel.userId = getUserId();
974    
975                    passwordPolicyCacheModel.userName = getUserName();
976    
977                    String userName = passwordPolicyCacheModel.userName;
978    
979                    if ((userName != null) && (userName.length() == 0)) {
980                            passwordPolicyCacheModel.userName = null;
981                    }
982    
983                    Date createDate = getCreateDate();
984    
985                    if (createDate != null) {
986                            passwordPolicyCacheModel.createDate = createDate.getTime();
987                    }
988                    else {
989                            passwordPolicyCacheModel.createDate = Long.MIN_VALUE;
990                    }
991    
992                    Date modifiedDate = getModifiedDate();
993    
994                    if (modifiedDate != null) {
995                            passwordPolicyCacheModel.modifiedDate = modifiedDate.getTime();
996                    }
997                    else {
998                            passwordPolicyCacheModel.modifiedDate = Long.MIN_VALUE;
999                    }
1000    
1001                    passwordPolicyCacheModel.defaultPolicy = getDefaultPolicy();
1002    
1003                    passwordPolicyCacheModel.name = getName();
1004    
1005                    String name = passwordPolicyCacheModel.name;
1006    
1007                    if ((name != null) && (name.length() == 0)) {
1008                            passwordPolicyCacheModel.name = null;
1009                    }
1010    
1011                    passwordPolicyCacheModel.description = getDescription();
1012    
1013                    String description = passwordPolicyCacheModel.description;
1014    
1015                    if ((description != null) && (description.length() == 0)) {
1016                            passwordPolicyCacheModel.description = null;
1017                    }
1018    
1019                    passwordPolicyCacheModel.changeable = getChangeable();
1020    
1021                    passwordPolicyCacheModel.changeRequired = getChangeRequired();
1022    
1023                    passwordPolicyCacheModel.minAge = getMinAge();
1024    
1025                    passwordPolicyCacheModel.checkSyntax = getCheckSyntax();
1026    
1027                    passwordPolicyCacheModel.allowDictionaryWords = getAllowDictionaryWords();
1028    
1029                    passwordPolicyCacheModel.minAlphanumeric = getMinAlphanumeric();
1030    
1031                    passwordPolicyCacheModel.minLength = getMinLength();
1032    
1033                    passwordPolicyCacheModel.minLowerCase = getMinLowerCase();
1034    
1035                    passwordPolicyCacheModel.minNumbers = getMinNumbers();
1036    
1037                    passwordPolicyCacheModel.minSymbols = getMinSymbols();
1038    
1039                    passwordPolicyCacheModel.minUpperCase = getMinUpperCase();
1040    
1041                    passwordPolicyCacheModel.history = getHistory();
1042    
1043                    passwordPolicyCacheModel.historyCount = getHistoryCount();
1044    
1045                    passwordPolicyCacheModel.expireable = getExpireable();
1046    
1047                    passwordPolicyCacheModel.maxAge = getMaxAge();
1048    
1049                    passwordPolicyCacheModel.warningTime = getWarningTime();
1050    
1051                    passwordPolicyCacheModel.graceLimit = getGraceLimit();
1052    
1053                    passwordPolicyCacheModel.lockout = getLockout();
1054    
1055                    passwordPolicyCacheModel.maxFailure = getMaxFailure();
1056    
1057                    passwordPolicyCacheModel.lockoutDuration = getLockoutDuration();
1058    
1059                    passwordPolicyCacheModel.requireUnlock = getRequireUnlock();
1060    
1061                    passwordPolicyCacheModel.resetFailureCount = getResetFailureCount();
1062    
1063                    passwordPolicyCacheModel.resetTicketMaxAge = getResetTicketMaxAge();
1064    
1065                    return passwordPolicyCacheModel;
1066            }
1067    
1068            @Override
1069            public String toString() {
1070                    StringBundler sb = new StringBundler(65);
1071    
1072                    sb.append("{passwordPolicyId=");
1073                    sb.append(getPasswordPolicyId());
1074                    sb.append(", companyId=");
1075                    sb.append(getCompanyId());
1076                    sb.append(", userId=");
1077                    sb.append(getUserId());
1078                    sb.append(", userName=");
1079                    sb.append(getUserName());
1080                    sb.append(", createDate=");
1081                    sb.append(getCreateDate());
1082                    sb.append(", modifiedDate=");
1083                    sb.append(getModifiedDate());
1084                    sb.append(", defaultPolicy=");
1085                    sb.append(getDefaultPolicy());
1086                    sb.append(", name=");
1087                    sb.append(getName());
1088                    sb.append(", description=");
1089                    sb.append(getDescription());
1090                    sb.append(", changeable=");
1091                    sb.append(getChangeable());
1092                    sb.append(", changeRequired=");
1093                    sb.append(getChangeRequired());
1094                    sb.append(", minAge=");
1095                    sb.append(getMinAge());
1096                    sb.append(", checkSyntax=");
1097                    sb.append(getCheckSyntax());
1098                    sb.append(", allowDictionaryWords=");
1099                    sb.append(getAllowDictionaryWords());
1100                    sb.append(", minAlphanumeric=");
1101                    sb.append(getMinAlphanumeric());
1102                    sb.append(", minLength=");
1103                    sb.append(getMinLength());
1104                    sb.append(", minLowerCase=");
1105                    sb.append(getMinLowerCase());
1106                    sb.append(", minNumbers=");
1107                    sb.append(getMinNumbers());
1108                    sb.append(", minSymbols=");
1109                    sb.append(getMinSymbols());
1110                    sb.append(", minUpperCase=");
1111                    sb.append(getMinUpperCase());
1112                    sb.append(", history=");
1113                    sb.append(getHistory());
1114                    sb.append(", historyCount=");
1115                    sb.append(getHistoryCount());
1116                    sb.append(", expireable=");
1117                    sb.append(getExpireable());
1118                    sb.append(", maxAge=");
1119                    sb.append(getMaxAge());
1120                    sb.append(", warningTime=");
1121                    sb.append(getWarningTime());
1122                    sb.append(", graceLimit=");
1123                    sb.append(getGraceLimit());
1124                    sb.append(", lockout=");
1125                    sb.append(getLockout());
1126                    sb.append(", maxFailure=");
1127                    sb.append(getMaxFailure());
1128                    sb.append(", lockoutDuration=");
1129                    sb.append(getLockoutDuration());
1130                    sb.append(", requireUnlock=");
1131                    sb.append(getRequireUnlock());
1132                    sb.append(", resetFailureCount=");
1133                    sb.append(getResetFailureCount());
1134                    sb.append(", resetTicketMaxAge=");
1135                    sb.append(getResetTicketMaxAge());
1136                    sb.append("}");
1137    
1138                    return sb.toString();
1139            }
1140    
1141            public String toXmlString() {
1142                    StringBundler sb = new StringBundler(100);
1143    
1144                    sb.append("<model><model-name>");
1145                    sb.append("com.liferay.portal.model.PasswordPolicy");
1146                    sb.append("</model-name>");
1147    
1148                    sb.append(
1149                            "<column><column-name>passwordPolicyId</column-name><column-value><![CDATA[");
1150                    sb.append(getPasswordPolicyId());
1151                    sb.append("]]></column-value></column>");
1152                    sb.append(
1153                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1154                    sb.append(getCompanyId());
1155                    sb.append("]]></column-value></column>");
1156                    sb.append(
1157                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1158                    sb.append(getUserId());
1159                    sb.append("]]></column-value></column>");
1160                    sb.append(
1161                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1162                    sb.append(getUserName());
1163                    sb.append("]]></column-value></column>");
1164                    sb.append(
1165                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1166                    sb.append(getCreateDate());
1167                    sb.append("]]></column-value></column>");
1168                    sb.append(
1169                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1170                    sb.append(getModifiedDate());
1171                    sb.append("]]></column-value></column>");
1172                    sb.append(
1173                            "<column><column-name>defaultPolicy</column-name><column-value><![CDATA[");
1174                    sb.append(getDefaultPolicy());
1175                    sb.append("]]></column-value></column>");
1176                    sb.append(
1177                            "<column><column-name>name</column-name><column-value><![CDATA[");
1178                    sb.append(getName());
1179                    sb.append("]]></column-value></column>");
1180                    sb.append(
1181                            "<column><column-name>description</column-name><column-value><![CDATA[");
1182                    sb.append(getDescription());
1183                    sb.append("]]></column-value></column>");
1184                    sb.append(
1185                            "<column><column-name>changeable</column-name><column-value><![CDATA[");
1186                    sb.append(getChangeable());
1187                    sb.append("]]></column-value></column>");
1188                    sb.append(
1189                            "<column><column-name>changeRequired</column-name><column-value><![CDATA[");
1190                    sb.append(getChangeRequired());
1191                    sb.append("]]></column-value></column>");
1192                    sb.append(
1193                            "<column><column-name>minAge</column-name><column-value><![CDATA[");
1194                    sb.append(getMinAge());
1195                    sb.append("]]></column-value></column>");
1196                    sb.append(
1197                            "<column><column-name>checkSyntax</column-name><column-value><![CDATA[");
1198                    sb.append(getCheckSyntax());
1199                    sb.append("]]></column-value></column>");
1200                    sb.append(
1201                            "<column><column-name>allowDictionaryWords</column-name><column-value><![CDATA[");
1202                    sb.append(getAllowDictionaryWords());
1203                    sb.append("]]></column-value></column>");
1204                    sb.append(
1205                            "<column><column-name>minAlphanumeric</column-name><column-value><![CDATA[");
1206                    sb.append(getMinAlphanumeric());
1207                    sb.append("]]></column-value></column>");
1208                    sb.append(
1209                            "<column><column-name>minLength</column-name><column-value><![CDATA[");
1210                    sb.append(getMinLength());
1211                    sb.append("]]></column-value></column>");
1212                    sb.append(
1213                            "<column><column-name>minLowerCase</column-name><column-value><![CDATA[");
1214                    sb.append(getMinLowerCase());
1215                    sb.append("]]></column-value></column>");
1216                    sb.append(
1217                            "<column><column-name>minNumbers</column-name><column-value><![CDATA[");
1218                    sb.append(getMinNumbers());
1219                    sb.append("]]></column-value></column>");
1220                    sb.append(
1221                            "<column><column-name>minSymbols</column-name><column-value><![CDATA[");
1222                    sb.append(getMinSymbols());
1223                    sb.append("]]></column-value></column>");
1224                    sb.append(
1225                            "<column><column-name>minUpperCase</column-name><column-value><![CDATA[");
1226                    sb.append(getMinUpperCase());
1227                    sb.append("]]></column-value></column>");
1228                    sb.append(
1229                            "<column><column-name>history</column-name><column-value><![CDATA[");
1230                    sb.append(getHistory());
1231                    sb.append("]]></column-value></column>");
1232                    sb.append(
1233                            "<column><column-name>historyCount</column-name><column-value><![CDATA[");
1234                    sb.append(getHistoryCount());
1235                    sb.append("]]></column-value></column>");
1236                    sb.append(
1237                            "<column><column-name>expireable</column-name><column-value><![CDATA[");
1238                    sb.append(getExpireable());
1239                    sb.append("]]></column-value></column>");
1240                    sb.append(
1241                            "<column><column-name>maxAge</column-name><column-value><![CDATA[");
1242                    sb.append(getMaxAge());
1243                    sb.append("]]></column-value></column>");
1244                    sb.append(
1245                            "<column><column-name>warningTime</column-name><column-value><![CDATA[");
1246                    sb.append(getWarningTime());
1247                    sb.append("]]></column-value></column>");
1248                    sb.append(
1249                            "<column><column-name>graceLimit</column-name><column-value><![CDATA[");
1250                    sb.append(getGraceLimit());
1251                    sb.append("]]></column-value></column>");
1252                    sb.append(
1253                            "<column><column-name>lockout</column-name><column-value><![CDATA[");
1254                    sb.append(getLockout());
1255                    sb.append("]]></column-value></column>");
1256                    sb.append(
1257                            "<column><column-name>maxFailure</column-name><column-value><![CDATA[");
1258                    sb.append(getMaxFailure());
1259                    sb.append("]]></column-value></column>");
1260                    sb.append(
1261                            "<column><column-name>lockoutDuration</column-name><column-value><![CDATA[");
1262                    sb.append(getLockoutDuration());
1263                    sb.append("]]></column-value></column>");
1264                    sb.append(
1265                            "<column><column-name>requireUnlock</column-name><column-value><![CDATA[");
1266                    sb.append(getRequireUnlock());
1267                    sb.append("]]></column-value></column>");
1268                    sb.append(
1269                            "<column><column-name>resetFailureCount</column-name><column-value><![CDATA[");
1270                    sb.append(getResetFailureCount());
1271                    sb.append("]]></column-value></column>");
1272                    sb.append(
1273                            "<column><column-name>resetTicketMaxAge</column-name><column-value><![CDATA[");
1274                    sb.append(getResetTicketMaxAge());
1275                    sb.append("]]></column-value></column>");
1276    
1277                    sb.append("</model>");
1278    
1279                    return sb.toString();
1280            }
1281    
1282            private static ClassLoader _classLoader = PasswordPolicy.class.getClassLoader();
1283            private static Class<?>[] _escapedModelInterfaces = new Class[] {
1284                            PasswordPolicy.class
1285                    };
1286            private long _passwordPolicyId;
1287            private long _companyId;
1288            private long _originalCompanyId;
1289            private boolean _setOriginalCompanyId;
1290            private long _userId;
1291            private String _userUuid;
1292            private String _userName;
1293            private Date _createDate;
1294            private Date _modifiedDate;
1295            private boolean _defaultPolicy;
1296            private boolean _originalDefaultPolicy;
1297            private boolean _setOriginalDefaultPolicy;
1298            private String _name;
1299            private String _originalName;
1300            private String _description;
1301            private boolean _changeable;
1302            private boolean _changeRequired;
1303            private long _minAge;
1304            private boolean _checkSyntax;
1305            private boolean _allowDictionaryWords;
1306            private int _minAlphanumeric;
1307            private int _minLength;
1308            private int _minLowerCase;
1309            private int _minNumbers;
1310            private int _minSymbols;
1311            private int _minUpperCase;
1312            private boolean _history;
1313            private int _historyCount;
1314            private boolean _expireable;
1315            private long _maxAge;
1316            private long _warningTime;
1317            private int _graceLimit;
1318            private boolean _lockout;
1319            private int _maxFailure;
1320            private long _lockoutDuration;
1321            private boolean _requireUnlock;
1322            private long _resetFailureCount;
1323            private long _resetTicketMaxAge;
1324            private long _columnBitmask;
1325            private PasswordPolicy _escapedModel;
1326    }