001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.model.impl;
022:
023: import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
024: import com.liferay.portal.kernel.util.GetterUtil;
025: import com.liferay.portal.model.PasswordPolicy;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.util.Html;
029:
030: import java.io.Serializable;
031:
032: import java.lang.reflect.Proxy;
033:
034: import java.sql.Types;
035:
036: import java.util.Date;
037:
038: /**
039: * <a href="PasswordPolicyModelImpl.java.html"><b><i>View Source</i></b></a>
040: *
041: * <p>
042: * ServiceBuilder generated this class. Modifications in this class will be
043: * overwritten the next time is generated.
044: * </p>
045: *
046: * <p>
047: * This class is a model that represents the <code>PasswordPolicy</code> table
048: * in the database.
049: * </p>
050: *
051: * @author Brian Wing Shun Chan
052: *
053: * @see com.liferay.portal.service.model.PasswordPolicy
054: * @see com.liferay.portal.service.model.PasswordPolicyModel
055: * @see com.liferay.portal.service.model.impl.PasswordPolicyImpl
056: *
057: */
058: public class PasswordPolicyModelImpl extends BaseModelImpl {
059: public static final String TABLE_NAME = "PasswordPolicy";
060: public static final Object[][] TABLE_COLUMNS = {
061: { "passwordPolicyId", new Integer(Types.BIGINT) },
062:
063: { "companyId", new Integer(Types.BIGINT) },
064:
065: { "userId", new Integer(Types.BIGINT) },
066:
067: { "userName", new Integer(Types.VARCHAR) },
068:
069: { "createDate", new Integer(Types.TIMESTAMP) },
070:
071: { "modifiedDate", new Integer(Types.TIMESTAMP) },
072:
073: { "defaultPolicy", new Integer(Types.BOOLEAN) },
074:
075: { "name", new Integer(Types.VARCHAR) },
076:
077: { "description", new Integer(Types.VARCHAR) },
078:
079: { "changeable", new Integer(Types.BOOLEAN) },
080:
081: { "changeRequired", new Integer(Types.BOOLEAN) },
082:
083: { "minAge", new Integer(Types.BIGINT) },
084:
085: { "checkSyntax", new Integer(Types.BOOLEAN) },
086:
087: { "allowDictionaryWords", new Integer(Types.BOOLEAN) },
088:
089: { "minLength", new Integer(Types.INTEGER) },
090:
091: { "history", new Integer(Types.BOOLEAN) },
092:
093: { "historyCount", new Integer(Types.INTEGER) },
094:
095: { "expireable", new Integer(Types.BOOLEAN) },
096:
097: { "maxAge", new Integer(Types.BIGINT) },
098:
099: { "warningTime", new Integer(Types.BIGINT) },
100:
101: { "graceLimit", new Integer(Types.INTEGER) },
102:
103: { "lockout", new Integer(Types.BOOLEAN) },
104:
105: { "maxFailure", new Integer(Types.INTEGER) },
106:
107: { "lockoutDuration", new Integer(Types.BIGINT) },
108:
109: { "requireUnlock", new Integer(Types.BOOLEAN) },
110:
111: { "resetFailureCount", new Integer(Types.BIGINT) } };
112: 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,minLength INTEGER,history BOOLEAN,historyCount INTEGER,expireable BOOLEAN,maxAge LONG,warningTime LONG,graceLimit INTEGER,lockout BOOLEAN,maxFailure INTEGER,lockoutDuration LONG,requireUnlock BOOLEAN,resetFailureCount LONG)";
113: public static final String TABLE_SQL_DROP = "drop table PasswordPolicy";
114: public static final boolean CACHE_ENABLED = GetterUtil
115: .getBoolean(
116: PropsUtil
117: .get("value.object.finder.cache.enabled.com.liferay.portal.model.PasswordPolicy"),
118: true);
119: public static final long LOCK_EXPIRATION_TIME = GetterUtil
120: .getLong(PropsUtil
121: .get("lock.expiration.time.com.liferay.portal.model.PasswordPolicy"));
122:
123: public PasswordPolicyModelImpl() {
124: }
125:
126: public long getPrimaryKey() {
127: return _passwordPolicyId;
128: }
129:
130: public void setPrimaryKey(long pk) {
131: setPasswordPolicyId(pk);
132: }
133:
134: public Serializable getPrimaryKeyObj() {
135: return new Long(_passwordPolicyId);
136: }
137:
138: public long getPasswordPolicyId() {
139: return _passwordPolicyId;
140: }
141:
142: public void setPasswordPolicyId(long passwordPolicyId) {
143: if (passwordPolicyId != _passwordPolicyId) {
144: _passwordPolicyId = passwordPolicyId;
145: }
146: }
147:
148: public long getCompanyId() {
149: return _companyId;
150: }
151:
152: public void setCompanyId(long companyId) {
153: if (companyId != _companyId) {
154: _companyId = companyId;
155: }
156: }
157:
158: public long getUserId() {
159: return _userId;
160: }
161:
162: public void setUserId(long userId) {
163: if (userId != _userId) {
164: _userId = userId;
165: }
166: }
167:
168: public String getUserName() {
169: return GetterUtil.getString(_userName);
170: }
171:
172: public void setUserName(String userName) {
173: if (((userName == null) && (_userName != null))
174: || ((userName != null) && (_userName == null))
175: || ((userName != null) && (_userName != null) && !userName
176: .equals(_userName))) {
177: _userName = userName;
178: }
179: }
180:
181: public Date getCreateDate() {
182: return _createDate;
183: }
184:
185: public void setCreateDate(Date createDate) {
186: if (((createDate == null) && (_createDate != null))
187: || ((createDate != null) && (_createDate == null))
188: || ((createDate != null) && (_createDate != null) && !createDate
189: .equals(_createDate))) {
190: _createDate = createDate;
191: }
192: }
193:
194: public Date getModifiedDate() {
195: return _modifiedDate;
196: }
197:
198: public void setModifiedDate(Date modifiedDate) {
199: if (((modifiedDate == null) && (_modifiedDate != null))
200: || ((modifiedDate != null) && (_modifiedDate == null))
201: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
202: .equals(_modifiedDate))) {
203: _modifiedDate = modifiedDate;
204: }
205: }
206:
207: public boolean getDefaultPolicy() {
208: return _defaultPolicy;
209: }
210:
211: public boolean isDefaultPolicy() {
212: return _defaultPolicy;
213: }
214:
215: public void setDefaultPolicy(boolean defaultPolicy) {
216: if (defaultPolicy != _defaultPolicy) {
217: _defaultPolicy = defaultPolicy;
218: }
219: }
220:
221: public String getName() {
222: return GetterUtil.getString(_name);
223: }
224:
225: public void setName(String name) {
226: if (((name == null) && (_name != null))
227: || ((name != null) && (_name == null))
228: || ((name != null) && (_name != null) && !name
229: .equals(_name))) {
230: _name = name;
231: }
232: }
233:
234: public String getDescription() {
235: return GetterUtil.getString(_description);
236: }
237:
238: public void setDescription(String description) {
239: if (((description == null) && (_description != null))
240: || ((description != null) && (_description == null))
241: || ((description != null) && (_description != null) && !description
242: .equals(_description))) {
243: _description = description;
244: }
245: }
246:
247: public boolean getChangeable() {
248: return _changeable;
249: }
250:
251: public boolean isChangeable() {
252: return _changeable;
253: }
254:
255: public void setChangeable(boolean changeable) {
256: if (changeable != _changeable) {
257: _changeable = changeable;
258: }
259: }
260:
261: public boolean getChangeRequired() {
262: return _changeRequired;
263: }
264:
265: public boolean isChangeRequired() {
266: return _changeRequired;
267: }
268:
269: public void setChangeRequired(boolean changeRequired) {
270: if (changeRequired != _changeRequired) {
271: _changeRequired = changeRequired;
272: }
273: }
274:
275: public long getMinAge() {
276: return _minAge;
277: }
278:
279: public void setMinAge(long minAge) {
280: if (minAge != _minAge) {
281: _minAge = minAge;
282: }
283: }
284:
285: public boolean getCheckSyntax() {
286: return _checkSyntax;
287: }
288:
289: public boolean isCheckSyntax() {
290: return _checkSyntax;
291: }
292:
293: public void setCheckSyntax(boolean checkSyntax) {
294: if (checkSyntax != _checkSyntax) {
295: _checkSyntax = checkSyntax;
296: }
297: }
298:
299: public boolean getAllowDictionaryWords() {
300: return _allowDictionaryWords;
301: }
302:
303: public boolean isAllowDictionaryWords() {
304: return _allowDictionaryWords;
305: }
306:
307: public void setAllowDictionaryWords(boolean allowDictionaryWords) {
308: if (allowDictionaryWords != _allowDictionaryWords) {
309: _allowDictionaryWords = allowDictionaryWords;
310: }
311: }
312:
313: public int getMinLength() {
314: return _minLength;
315: }
316:
317: public void setMinLength(int minLength) {
318: if (minLength != _minLength) {
319: _minLength = minLength;
320: }
321: }
322:
323: public boolean getHistory() {
324: return _history;
325: }
326:
327: public boolean isHistory() {
328: return _history;
329: }
330:
331: public void setHistory(boolean history) {
332: if (history != _history) {
333: _history = history;
334: }
335: }
336:
337: public int getHistoryCount() {
338: return _historyCount;
339: }
340:
341: public void setHistoryCount(int historyCount) {
342: if (historyCount != _historyCount) {
343: _historyCount = historyCount;
344: }
345: }
346:
347: public boolean getExpireable() {
348: return _expireable;
349: }
350:
351: public boolean isExpireable() {
352: return _expireable;
353: }
354:
355: public void setExpireable(boolean expireable) {
356: if (expireable != _expireable) {
357: _expireable = expireable;
358: }
359: }
360:
361: public long getMaxAge() {
362: return _maxAge;
363: }
364:
365: public void setMaxAge(long maxAge) {
366: if (maxAge != _maxAge) {
367: _maxAge = maxAge;
368: }
369: }
370:
371: public long getWarningTime() {
372: return _warningTime;
373: }
374:
375: public void setWarningTime(long warningTime) {
376: if (warningTime != _warningTime) {
377: _warningTime = warningTime;
378: }
379: }
380:
381: public int getGraceLimit() {
382: return _graceLimit;
383: }
384:
385: public void setGraceLimit(int graceLimit) {
386: if (graceLimit != _graceLimit) {
387: _graceLimit = graceLimit;
388: }
389: }
390:
391: public boolean getLockout() {
392: return _lockout;
393: }
394:
395: public boolean isLockout() {
396: return _lockout;
397: }
398:
399: public void setLockout(boolean lockout) {
400: if (lockout != _lockout) {
401: _lockout = lockout;
402: }
403: }
404:
405: public int getMaxFailure() {
406: return _maxFailure;
407: }
408:
409: public void setMaxFailure(int maxFailure) {
410: if (maxFailure != _maxFailure) {
411: _maxFailure = maxFailure;
412: }
413: }
414:
415: public long getLockoutDuration() {
416: return _lockoutDuration;
417: }
418:
419: public void setLockoutDuration(long lockoutDuration) {
420: if (lockoutDuration != _lockoutDuration) {
421: _lockoutDuration = lockoutDuration;
422: }
423: }
424:
425: public boolean getRequireUnlock() {
426: return _requireUnlock;
427: }
428:
429: public boolean isRequireUnlock() {
430: return _requireUnlock;
431: }
432:
433: public void setRequireUnlock(boolean requireUnlock) {
434: if (requireUnlock != _requireUnlock) {
435: _requireUnlock = requireUnlock;
436: }
437: }
438:
439: public long getResetFailureCount() {
440: return _resetFailureCount;
441: }
442:
443: public void setResetFailureCount(long resetFailureCount) {
444: if (resetFailureCount != _resetFailureCount) {
445: _resetFailureCount = resetFailureCount;
446: }
447: }
448:
449: public PasswordPolicy toEscapedModel() {
450: if (isEscapedModel()) {
451: return (PasswordPolicy) this ;
452: } else {
453: PasswordPolicy model = new PasswordPolicyImpl();
454:
455: model.setEscapedModel(true);
456:
457: model.setPasswordPolicyId(getPasswordPolicyId());
458: model.setCompanyId(getCompanyId());
459: model.setUserId(getUserId());
460: model.setUserName(Html.escape(getUserName()));
461: model.setCreateDate(getCreateDate());
462: model.setModifiedDate(getModifiedDate());
463: model.setDefaultPolicy(getDefaultPolicy());
464: model.setName(Html.escape(getName()));
465: model.setDescription(Html.escape(getDescription()));
466: model.setChangeable(getChangeable());
467: model.setChangeRequired(getChangeRequired());
468: model.setMinAge(getMinAge());
469: model.setCheckSyntax(getCheckSyntax());
470: model.setAllowDictionaryWords(getAllowDictionaryWords());
471: model.setMinLength(getMinLength());
472: model.setHistory(getHistory());
473: model.setHistoryCount(getHistoryCount());
474: model.setExpireable(getExpireable());
475: model.setMaxAge(getMaxAge());
476: model.setWarningTime(getWarningTime());
477: model.setGraceLimit(getGraceLimit());
478: model.setLockout(getLockout());
479: model.setMaxFailure(getMaxFailure());
480: model.setLockoutDuration(getLockoutDuration());
481: model.setRequireUnlock(getRequireUnlock());
482: model.setResetFailureCount(getResetFailureCount());
483:
484: model = (PasswordPolicy) Proxy.newProxyInstance(
485: PasswordPolicy.class.getClassLoader(),
486: new Class[] { PasswordPolicy.class },
487: new ReadOnlyBeanHandler(model));
488:
489: return model;
490: }
491: }
492:
493: public Object clone() {
494: PasswordPolicyImpl clone = new PasswordPolicyImpl();
495:
496: clone.setPasswordPolicyId(getPasswordPolicyId());
497: clone.setCompanyId(getCompanyId());
498: clone.setUserId(getUserId());
499: clone.setUserName(getUserName());
500: clone.setCreateDate(getCreateDate());
501: clone.setModifiedDate(getModifiedDate());
502: clone.setDefaultPolicy(getDefaultPolicy());
503: clone.setName(getName());
504: clone.setDescription(getDescription());
505: clone.setChangeable(getChangeable());
506: clone.setChangeRequired(getChangeRequired());
507: clone.setMinAge(getMinAge());
508: clone.setCheckSyntax(getCheckSyntax());
509: clone.setAllowDictionaryWords(getAllowDictionaryWords());
510: clone.setMinLength(getMinLength());
511: clone.setHistory(getHistory());
512: clone.setHistoryCount(getHistoryCount());
513: clone.setExpireable(getExpireable());
514: clone.setMaxAge(getMaxAge());
515: clone.setWarningTime(getWarningTime());
516: clone.setGraceLimit(getGraceLimit());
517: clone.setLockout(getLockout());
518: clone.setMaxFailure(getMaxFailure());
519: clone.setLockoutDuration(getLockoutDuration());
520: clone.setRequireUnlock(getRequireUnlock());
521: clone.setResetFailureCount(getResetFailureCount());
522:
523: return clone;
524: }
525:
526: public int compareTo(Object obj) {
527: if (obj == null) {
528: return -1;
529: }
530:
531: PasswordPolicyImpl passwordPolicy = (PasswordPolicyImpl) obj;
532:
533: long pk = passwordPolicy.getPrimaryKey();
534:
535: if (getPrimaryKey() < pk) {
536: return -1;
537: } else if (getPrimaryKey() > pk) {
538: return 1;
539: } else {
540: return 0;
541: }
542: }
543:
544: public boolean equals(Object obj) {
545: if (obj == null) {
546: return false;
547: }
548:
549: PasswordPolicyImpl passwordPolicy = null;
550:
551: try {
552: passwordPolicy = (PasswordPolicyImpl) obj;
553: } catch (ClassCastException cce) {
554: return false;
555: }
556:
557: long pk = passwordPolicy.getPrimaryKey();
558:
559: if (getPrimaryKey() == pk) {
560: return true;
561: } else {
562: return false;
563: }
564: }
565:
566: public int hashCode() {
567: return (int) getPrimaryKey();
568: }
569:
570: private long _passwordPolicyId;
571: private long _companyId;
572: private long _userId;
573: private String _userName;
574: private Date _createDate;
575: private Date _modifiedDate;
576: private boolean _defaultPolicy;
577: private String _name;
578: private String _description;
579: private boolean _changeable;
580: private boolean _changeRequired;
581: private long _minAge;
582: private boolean _checkSyntax;
583: private boolean _allowDictionaryWords;
584: private int _minLength;
585: private boolean _history;
586: private int _historyCount;
587: private boolean _expireable;
588: private long _maxAge;
589: private long _warningTime;
590: private int _graceLimit;
591: private boolean _lockout;
592: private int _maxFailure;
593: private long _lockoutDuration;
594: private boolean _requireUnlock;
595: private long _resetFailureCount;
596: }
|