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